Using NPM Offline - Pt 3
This is a continuation of Using NPM Offline.
Another popular lazy caching proxy for npm is npm_lazy. Similar to
local-npm, once setup any modules requested that aren't in the local cache are fetched from the npm registry lazily.
npm_lazy, the only things cached are package index metadata and package tarfiles. Pretty much all other endpoints get transparently proxied. This means an
npm install for cached packages will always work and (mostly the same as
local-npm), more exotic endpoints won't work if the main registry or mirrors are down - they'll act as their non-npm_lazy equivalents.
$ npm install -g npm_lazy
To start the server, run:
local-npm, the registry can be set to the local server running as follows:
$ npm config set registry http://localhost:8080/
npm_lazy has a relatively decent level of configuration, allowing customisation of the lifespan of the cache, maximum retries, HTTP timeouts and whether HTTPS requests are checked against Node's list of certificate authorities.
In this post I've looked at offline package installation, but you may also be interested in offline package bundling. This is where you want to bundle a package and all of its dependencies into a single archive for sharing with a system that might be offline. This comes up a lot in workshops.
Freight - can bundle both npm and bower dependencies into a compressed archive
npmbox - similarly supports creating/installing dependencies from a single archive
bundle-dependencies - deeply bundles all module dependencies for a package into a monolithic package you would later publish to npm
Article Source: Using NPM Offline
All credit goes to Addy Osmani.
This text has been copied solely for demonstrative purposes.