4 ms·
I've tended to avoid both underscore and lodash because they're both in the slew of monolithic pre-npm libraries, however the lazy evaluation looks interesting.
by andrezsanchez 12y ago
I've tended to avoid both underscore and lodash because they're both in the slew of monolithic pre-npm libraries, however the lazy evaluation looks interesting. I wouldn't be surprised to find a library that handles lazy eval without all the extra features Lodash brings.
- jgalt212 12y agoFor the shops who don't live and breath js and whose js work is almost entirely browser-based, these monoliths are great. I, for one, am bummed that the js market is moving away from monoliths. e.g. YUI shutting down.
- andrezsanchez 12y agoThat's an interesting perspective. I don't have any inherent problems with large libraries, but my problem with some of these 'monoliths' is that other libraries start to depend on the entire library when they only need a small piece of functionality that the library provides. Substack wrote an article [1] explaining some of the problems that monolithic libraries cause in an ecosystem. [1] http://substack.net/many_things http://substack.net/many_things
- jgalt212 12y agothanks, I'll check that out.
- acjohnson55 12y agoThere is lazy.js (http://danieltao.com/lazy.js/ http://danieltao.com/lazy.js/). Also, lodash is highly factored into pieces if you don't want the whole thing.
- WickyNilliams 12y agoWith browserify (or webpack) you can require just the functions you want, and only those (and their dependencies) end up in your code base. This is covered in the changelog
- jdd 12y agolodash offers modules for node, es6, amd, individual npm packages and bundled in the primary npm package so you can even do require('lodash/array/chunk').
- andrezsanchez 12y agoI remember trying this a while ago and being disappointed at the amount of dependency code brought in for a rather trivial function, but the modularization is looking much better than it was last time I took a look.