A simple script that hashes the package.json file. Stores a archive in cache folder. On next install checks if there is a file with the same hash. If so it extracts that else it will do "npm install" and then create a cached hash archive.
This script idea is heavily based on npm-cache by swarajban. But without bower and composer compatibility . I suggest you check his out.
NOTE: this scripts requires 7zip command-line tool to work
Install with brew
brew install p7zip
Install with Chocolatey
choco install 7zip.commandline
npm install -g npm-package-cache
npm-package-cache install
You can also add -f
to make do an npm install --force
if you need to
npm-package-cache install -f
To remove all cached files do
npm-package-cache clean
This script is used for personal projects. Maintenance hasn't been thought out.