mirror of
https://github.com/nodejs/node.git
synced 2025-05-20 22:43:26 +00:00
![]() PR-URL: https://github.com/nodejs/node/pull/25804 Reviewed-By: Myles Borins <myles.borins@gmail.com> |
||
---|---|---|
.. | ||
node_modules | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
index.js | ||
LICENSE | ||
package.json | ||
PULL_REQUEST_TEMPLATE | ||
README.md |
libnpmconfig

libnpmconfig
is a Node.js library for
programmatically managing npm's configuration files and data.
Example
const config = require('libnpmconfig')
console.log('configured registry:', config.read({
registry: 'https://default.registry/'
}))
// => configured registry: https://registry.npmjs.org
Install
$ npm install libnpmconfig
Table of Contents
API
> 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.