Interesting fact that I recently came across:<p>bower and many other npm packages, has some dependencies that eventually depends on a package called "wordwrap".<p>And this "wordwrap" package somehow has its test folder exposed in npm.<p>The result:<p>Every single person using bower would have <i></i>one or more<i></i> copies of <i>In Praise of Idleness</i> by Bertrand Russell on your local machine, depending on how many of your projects has a npm dependency of this package:<p><a href="https://github.com/substack/node-wordwrap/blob/master/test/idleness.txt" rel="nofollow">https://github.com/substack/node-wordwrap/blob/master/test/i...</a><p>Don't believe me? Try searching for "In Praise of Idleness" in Spotlight.<p>Edit: Someone had already sent a PR about this on GitHub:
<a href="https://github.com/substack/node-wordwrap/pull/14" rel="nofollow">https://github.com/substack/node-wordwrap/pull/14</a>
This person is counting the node_modules directory. While JS is a bit insane and this directory will have a ridiculous number of files, they are concerned:<p>"because my deployment (google app engine) allows only 10K files"<p>meaning, they don't realize that node_modules is for development and not related to the application they would actually deploy.
I did a bit of investigation into angular2 dependancies. It has alot more than angular1 and react<p><a href="http://royka.github.io/2016/05/03/front-end-deps.html" rel="nofollow">http://royka.github.io/2016/05/03/front-end-deps.html</a>
I started working with Laravel not long ago and found my project folder had 24,000+ files in it. And those don't compile down before you deploy... it makes me feel like I'm working on the tip of an unstable iceberg. Who the hell knows what's going on down there. No one person could possibly hope to know what it all actually does.
babel 6 with jsx transformer used to install a comparable number of files due to module duplication. At one point it was a 100M install with some modules being duplicated 45 times. Much of this was the fault of npm 2. But with latest babel and npm 3 it's now a 35M install with 5700 files over 814 directories. I guess that's considered lean by modern standards.
Is there a "distribution" bundle convention for npm ? Analogous to static linking, it would be one .js file that would bind all dependencies into a bundle (e.g. gulp.dist.js) . In that case you would end up with a much smaller number of dependency files to manage.
Reminds me of this talk that I just watched:
<a href="https://www.youtube.com/watch?v=k56wra39lwA" rel="nofollow">https://www.youtube.com/watch?v=k56wra39lwA</a>
At first glance, I thought the title was "Huge NO: on files for Angular 2" - a vulnerability report on filesystem capabilities of Angular 2 and why it should be abandoned
Has npm finally figured out how to de-dupe dependencies? In one project, I have something like 47 copies of the same version of the same library, distributed at all levels of the node_modules hierarchy.<p>I try not to think about that JS tooling too hard, lest I start pulling my hair out and devolve into a screaming crazy person.