Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes I agree it's better to have one library with 20 helper functions than 20 libraries with 1 function each. Think Lodash.

Although some people will then complain about the size of the library...



Yes. Every Lodash function is available in its own npm package too. I use it like this, I rather have 4 lodash packages than the big whole lodash library in one package with almost everything left unused.


These will go away in v5 (if a v5 is ever released) and is not recommended if using a bundler as it'll end up wasting space rather than saving as it'll include duplicate code that each individual function could share.

https://lodash.com/per-method-packages


Thanks for the information. I think it will be about time to completely remove lodash from my code bases.


JS libraries only did that to reduce bundle size being sent to the browser. It’s done out of necessity, not because it makes any sense.

Exporting out one method at a time is pretty absurd.


Lodash has a lot of features that are not needed anymore or even dangerous sometimes. If you don't need them, why would you install them?


Because it’s simply not a big deal on the server.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: