Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should Node.js module developers use Underscore.js?

I'm working on my 1st Node.js module, and having to do common utility stuff like check types, looping etc.

The native JS for some of this stuff is pretty ugly. Underscore.js makes it more readable and adds a lot of new features too. But if I don't need the new stuff, should I use Underscore or just do it the hard way?

Thanks!

like image 683
dylanized Avatar asked Apr 22 '26 14:04

dylanized


1 Answers

In node.is you can rely on having some ES5 stuff, array iteration functions and utility functions like isArray. In my node modules I never used underscore and had, due to array iteration functions like map, forEach never the need to use underscore or lodash.

I would not avoid a underscore dependency in case I'd really need it. The node.js platform relies on small modules depending on a couple of small modules itself. So why not depend on underscore.

like image 86
saintedlama Avatar answered Apr 24 '26 05:04

saintedlama



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!