tj / node-prune

Remove unnecessary files from node_modules (.md, .ts, ...)
MIT License
4.41k stars 130 forks source link

Is there an NPM Module? #9

Closed nebrelbug closed 6 years ago

nebrelbug commented 6 years ago

If not, I'd be interested in creating one...

tj commented 6 years ago

I was someone mention one on Twitter

jsu93 commented 6 years ago

npm install -g node-prune

vladholubiev commented 6 years ago

If you are using yarn go for yarn autoclean

https://yarnpkg.com/en/docs/cli/autoclean

xg-wang commented 6 years ago

just wrote one in ts https://github.com/xg-wang/pruner-cli

nebrelbug commented 6 years ago

Oh, okay. Cool!

benswinburne commented 5 years ago

Having just found this thread whilst looking to install this via NPM, as expected on NPM there are a fair few options but this package doesn't appear to be one of them.

I thought I'd have a quick look to see which one pruned most aggressively with the default settings. Results below in case they're any use to anyone.

git reset --hard HEAD; git clean -fd; rm -rf node_modules/; yarn;
du -sh
find . -type f | wc -l

control (unpruned)     23862      298M
autoclean              20514      274M      https://yarnpkg.com/en/docs/cli/autoclean
node-prune (bash)      18274      264M      https://github.com/tuananh/node-prune
modlcean (caution)     17053      250M      https://github.com/ModClean/modclean
nm-prune               18305      247M      https://github.com/pingyhq/nm-prune
pruner-cli             17017      241M      https://github.com/xg-wang/pruner-cli
node-prune (this lib)  17007      241M      https://github.com/tj/node-prune/
modclean (danger)      14496      212M      https://github.com/ModClean/modclean

Edit: I have also since found cruft but it doesn't seem to run 🤷‍♂️