|
|
2 years ago | |
|---|---|---|
| .. | ||
| node_modules | 2 years ago | |
| CHANGELOG.md | 2 years ago | |
| LICENSE | 2 years ago | |
| PULL_REQUEST_TEMPLATE | 2 years ago | |
| README.md | 2 years ago | |
| index.js | 2 years ago | |
| package.json | 2 years ago | |
libnpmconfig is a Node.js library for
programmatically managing npm's configuration files and data.
const config = require('libnpmconfig')
console.log('configured registry:', config.read({
registry: 'https://default.registry/'
}))
// => configured registry: https://registry.npmjs.org
$ npm install libnpmconfig
> read(cliOpts, builtinOpts)Reads configurations from the filesystem and the env and returns a
figgy-pudding object with the configuration
values.
If cliOpts is provided, it will be merged with the returned config pudding,
shadowing any read values. These are intended as CLI-provided options. Do your
own process.argv parsing, though.
If builtinOpts.cwd is provided, it will be used instead of process.cwd() as
the starting point for config searching.