NPM: I don't need your tests in my production!

131 views
Skip to first unread message

Ivan Nikulin

unread,
Sep 20, 2014, 8:59:26 AM9/20/14
to nod...@googlegroups.com

Packages in npm are bloated with stuff which you will never ever use, like build files and different kinds of test data. Guys from npm provided us with .npmignore files, but seems like almost no one uses it. Please, stop publishing your development stuff to npm. If I would like to run your tests and start hacking on your project I will do git clone not npm install. Once our project has increased in size in 13Mb and this is just because of single test data file which was used by one of our dependencies (true story). Poor testing farm...

So:

  • If you spread installed packages across multiple machines in your environment then bloated dependencies make you unhappy.
  • If you get your local repo synced (e.g using Dropbox or Google Drive) then bloated dependencies make you unhappy (it takes so goddamn long to sync a big amount of smal useless files).
  • If you distribute your project to end-user not via npm then bloated dependencies make you unhappy.
  • If you are a good person who cares about others then bloated dependencies make you unhappy. Just imagine how much useless stuff which will never be used by anyone is fetched, served and stored by npm and e.g. TravisCI. Imagine how thousands of small useless files impacts installation time of your package.
dmn ("dependency minifier" or "damn missing .npmignore" or "dmn is a meaningless name") - is a command line tool which will help you deal with bloated dependencies. It can clean your node_modulesfrom stuff which you will never need. And it can gracefully generate .npmignore file for your project.

Simon

unread,
Sep 22, 2014, 12:02:54 AM9/22/14
to nod...@googlegroups.com
Awesome!

mscdex

unread,
Sep 22, 2014, 10:33:06 AM9/22/14
to nod...@googlegroups.com
On Saturday, September 20, 2014 8:59:26 AM UTC-4, Ivan Nikulin wrote:

Please, stop publishing your development stuff to npm.


If you do that, then things like nodechecker.com will stop being useful. :-\
Reply all
Reply to author
Forward
0 new messages