Files
npm/node_modules/npmconf
isaacs ea547e29f1 Bump semver to version 3
This makes the '^' operator stricter for 0.x.y versions, even if 'x' is
not 0.

As a direct result, several *other* deps had to be updated, because they
either depended on semver 2.x, or because the new stricter rules meant
that they (or their deps) were no longer valid.

The update to 'read-installed', in particular, causes a test failure.
That update must be rolled back, or the test made to pass, prior to a
stable npm 2.0.0 release going out.
2014-07-24 17:52:02 -07:00
..
2014-07-18 14:17:19 -07:00
2014-07-24 17:52:02 -07:00
2014-07-18 23:11:57 -07:00
2014-07-18 23:11:57 -07:00
2012-09-12 20:22:54 -07:00
2014-07-24 17:52:02 -07:00
2012-08-14 19:47:40 -07:00

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