1.0.0 • Published 3 years ago

@summer-espresso/no-more v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

no-more

NOde MOdules REducer (no-more) reduces the total space used by the node_modules directories by mutualizing the modules in a cache using hard links.

How it works

The script parses the node_modules directory recursively and make a copy with hard links of each module into ~/.cache/node_modules. If a copy already exists then the copy will replace the current module with hard links.

Even with a single project node it can happen that there is a space saving. The space saving is much greater if no-more is used on several similar projects.

Installation

$ npm i -g @summer-espresso/no-more

Usage

$ cd your-node-project
$ no-more

It will take some time to process all the modules. You can check the gained or lost disk space by executing the df command before and after running no-more.

IMPORTANT

  • I am not responsible in any way for any problem that may result from the execution of this program or for any consequence that may result (loss of data, corruption, etc ...). You alone are responsible for its use at your own risks.

  • This script does not work under windows because shelljs does not support (yet) the -l option of the cp command.

  • This is not necessarily neither the most efficient algorithm nor the most efficient language, but it is a simple program that works.

  • I don't have a lot of time to devote to maintaining this program. If you want modifications you are encouraged to fork this very simple program or transpose it to other languages.

1.0.0

3 years ago