Easily pruning unnecessary files from
node_modules
.
Original script written by gpittarelli and neophob.
- Optimize package sizes for AWS lambda functions/layers
cd
to project root and issue the following command.
docker run --rm -v ${PWD}:/app hochzehn/node-prune
npm install -g node-prune
node-prune
In the directory where you want to perform the prune.
node-prune [path/to/prune]
This path is relative to your current working directory.
Output
Before: 135M (3653 files)
After: 112M (3102 files)
MIT