Cache `npm install` results by hashing dependencies

Language: JavaScript


Build Status Dependency Status devDependency Status

npm-pkgr caches npm install results by hashing dependencies from package.json and npm-shrinkwrap.json.

If your package.json did not change from last build, then you will immediately get either:

  • a symlink node_modules..
  • a full node_modules copy..

.. to the latest build result located in ~/.npm-pkgr

npm-pkgr frees your deployments from npm network issues and will make your deploys run fast.


npm install -g npm-pkgr

Use npm-pkgr instead of npm install and you are done.


Hashes and finds the latest build corresponding to package.json and npm-shrinkwrap.json.

npm-pkgr --production

Hashes and finds the latest build corresponding to npm-shrinkwrap.json.

npm-pkgr --show-npm-output

Displays npm's output, if npm install is run.

Every other flag passed to npm-pkgr is passed down to the npm install command.

Cache folder

The cache folder used by npm-pkgr is ~/.npm-pkgr for the current user.

npm-pkgr prune

Removes cache folders older than a month (in your ~/.npm-pkgr folder)


DEBUG=npm-pkgr* npm-pkgr

Will give you some debug information.


Default strategy is to symlink $CWD/node_modules -> ~/.npm-pkgr/$hash/node_modules.

You can also get a full copy of the ~/.npm-pkgr/$hash/node_modules.

npm-pkgr --strategy=copy

Careful, if you --strategy copy, you will end up installing the copy package


Use the --symlinks option if you wish make some files or folders from your project available during npm install.

For example if your project includes a local .cache folder for the npm cache and a node_shrinkwrap folder for pre-packaged modules, then you can use the following command to make those resources available when npm-pkgr runs npm install:

npm-pkgr --symlinks=.cache,node_shrinkwrap


Use the --cachepath option if you want use a specific folder for the cache folder.

npm-pkgr --cachepath=/data/node-vXXX/.npm-pkgr


  • insanely fast npm install if already done
  • npm install once in your CI server, deploy everywhere
  • solves shrinkwrap inconsistencies/problems
  • solves devDependencies updates even when you use a shrinkwrap
  • concurrent builds
  • get symlinks or copy to cached node_modules

Project Statistics

Sourcerank 7
Repository Size 220 KB
Stars 73
Forks 9
Watchers 1
Open issues 3
Dependencies 20
Contributors 7
Tags 14
Last updated
Last pushed

Top Contributors See all

Vincent Voyer Greg Bergé offirmo Adriaan Thomas Maxime Janton ftneo Yves-Emmanuel Jutard

Packages Referencing this Repo

Cache `npm install` results by hashing dependencies
Latest release 0.9.0 - Updated - 73 stars
Get the current npm version of the running system
Latest release 1.1.0 - Published - 73 stars

Recent Tags See all

v0.8.0 August 25, 2016
v0.7.0 April 01, 2016
v0.6.0 March 10, 2016
v0.5.0 February 24, 2016
v0.4.1 February 22, 2016
v0.4.0 February 22, 2016
0.3.0 November 19, 2015
v0.2.3 November 02, 2015
v0.2.2 November 02, 2015
v0.2.1 October 26, 2015
v0.2.0 September 11, 2014
v0.1.0 April 07, 2014
v0.0.2 April 07, 2014
v0.0.1 April 03, 2014

Something wrong with this page? Make a suggestion

Last synced: 2018-09-24 17:56:06 UTC

Login to resync this repository