https://github.com/npm/npmconf
npm config thing
https://github.com/npm/npmconf
Last synced: 10 months ago
JSON representation
npm config thing
- Host: GitHub
- URL: https://github.com/npm/npmconf
- Owner: npm
- License: isc
- Archived: true
- Created: 2012-08-15T00:34:53.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2016-01-05T19:32:13.000Z (over 10 years ago)
- Last Synced: 2024-10-29T20:26:48.389Z (over 1 year ago)
- Language: JavaScript
- Size: 193 KB
- Stars: 74
- Watchers: 25
- Forks: 47
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# npmconf
## THIS PACKAGE IS DEPRECATED
**This package's functionality has been reintegrated directly into npm. There
have been many changes made to npm's configuration since the last version of
this package was published. It should not be considered a source of truth for
npm configuration any longer, and npm itself is the best tool to use to manage
its configuration. _Do not use this package._**
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](https://github.com/dominictarr/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
```javascript
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
})
})
```