node/deps/npm/node_modules/npmconf
isaacs f76c3938d0 npm: upgrade to v1.4.8
* Check SHA before using files from cache
* adduser: allow change of the saved password
* Make `npm install` respect `config.unicode`
* Fix lifecycle to pass `Infinity` for config env value
* Don't return 0 exit code on invalid command
* cache: Handle 404s and other HTTP errors as errors
* bump tap dep, make tests stderr a bit quieter
* Resolve ~ in path configs to env.HOME
* Include npm version in default user-agent conf
* npm init: Use ISC as default license, use save-prefix for deps
* Many test and doc fixes
2014-05-01 11:09:00 -07:00
..
node_modules/config-chain npm: upgrade to 1.4.7 2014-04-15 15:31:36 -07:00
test npm: Upgrade to 1.3.17 2013-12-11 10:20:26 -08:00
.npmignore npm: Upgrade to 1.1.49 2012-08-14 20:27:28 -07:00
LICENSE npm: upgrade to 1.1.62 2012-09-25 08:29:05 -07:00
README.md npm: Upgrade to 1.1.49 2012-08-14 20:27:28 -07:00
config-defs.js npm: upgrade to v1.4.8 2014-05-01 11:09:00 -07:00
npmconf.js npm: Upgrade to 1.1.61 2012-09-10 09:11:54 -07:00
package.json npm: upgrade to v1.4.8 2014-05-01 11:09:00 -07:00

README.md

npmconf

The config thing npm uses

If you are interested in interacting with the config settings that npm uses, then use this module.

However, if you are writing a new Node.js program, and want configuration functionality similar to what npm has, but for your own thing, then I'd recommend using rc, which is probably what you want.

If I were to do it all over again, that's what I'd do for npm. But, alas, there are many systems depending on many of the particulars of npm's configuration setup, so it's not worth the cost of changing.

USAGE

var npmconf = require('npmconf')

// pass in the cli options that you read from the cli
// or whatever top-level configs you want npm to use for now.
npmconf.load({some:'configs'}, function (er, conf) {
  // do stuff with conf
  conf.get('some', 'cli') // 'configs'
  conf.get('username') // 'joebobwhatevers'
  conf.set('foo', 'bar', 'user')
  conf.save('user', function (er) {
    // foo = bar is now saved to ~/.npmrc or wherever
  })
})