You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
isaacs ff0de45929 npm: Upgrade to v1.3.5 12 years ago
..
node_modules/config-chain npm: Upgrade to 1.2.30 12 years ago
test npm: Upgrade to 1.1.61 12 years ago
.npmignore npm: Upgrade to 1.1.49 13 years ago
LICENSE npm: upgrade to 1.1.62 12 years ago
README.md npm: Upgrade to 1.1.49 13 years ago
config-defs.js npm: Upgrade to 1.3.2 12 years ago
npmconf.js npm: Upgrade to 1.1.61 12 years ago
package.json npm: Upgrade to v1.3.5 12 years ago

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
  })
})