Monday 29 June 2020

Im creating a npm package, should I use es6 modules or commonjs?

npm: https://www.npmjs.com/package/eventmongerHi,I've had this bit off code I kick around from project to project for emitting events and I figured now that I have time on my hand that I should make it into a real package!The main difference between this and other systems is that you pass the actual event around instead of using a string, that way a linter can help you out and you cant misspell events.That also lets it be faster since there is no indexing events. I did some benchmarking and it seems like its faster than EventEmiter3.I was wounding if people had any tips on how to speed it up more or any other feedback. I'm currently using es6 modules and was wondering if that's considered okay or if I should use commonjs.Thanks in advance!

Submitted June 29, 2020 at 10:10PM by FelixMo42

No comments:

Post a Comment