npm registry environment manager


easy directory-level configuration scoping for npm

npm install -g envpm

envpm proxies commands to npm, but (in the event of a .npmrc file in your current working directory or any directory up from that) uses the configuration information present in that file.

The only command provided by envpm is which, used as such:

envpm which

This will print the location to the .npmrc that envpm will source if run from your current working directory.

If you'd like to make npm cache dir aware all the time, put the following command in your .bashrc:

alias npm=envnpm

Important: Be sure to set a different cache directory in your overridden .npmrc so that your private cache doesn't interfere with your public cache (and vice versa). Here's an example (minimal) .npmrc:

var envpm = require('envpm')
envpm(dir, args) // executes npm with args, 
                 // looking for .npmrc file starting in dir