Reduce npm payload size by updating .npmignore #2124
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks for creating a module I used every day! I'm trying to give back in whatever little way I can.
The npm payload delivered from
npm install request
contains a few files which are not needed for the module to actually work, so I added these things to the.npmignore
file. Here is the data for your package before and after this change:I got these numbers using
du -shk <directory>
The difference between the "Including / Excluding deps" columns is whether or not the
node_modules/
directory containingrequest
's dependencies is included.According to
request
's npmjs.com page,request
has been downloaded 588,799 times in the last day. At 276 KB per download (ignoringrequest
's dependencies), that is 162.5 GB per day for this module alone! With this change, that number drops by 5.80% to 153.1 GB.In case you want to double check the resulting package, you can do so locally: