• Home
Name Date Size #Lines LOC

..--

node_modules/12-May-2024-1,120807

CHANGELOG.mdD12-May-20241.3 KiB5222

LICENSED12-May-2024717 1411

PULL_REQUEST_TEMPLATED12-May-2024183 80

README.mdD12-May-20241.6 KiB4127

index.jsD12-May-20242.8 KiB10897

package.jsonD12-May-20242 KiB6766

README.md

1# libnpmconfig [![npm version](https://img.shields.io/npm/v/libnpmconfig.svg)](https://npm.im/libnpmconfig) [![license](https://img.shields.io/npm/l/libnpmconfig.svg)](https://npm.im/libnpmconfig) [![Travis](https://img.shields.io/travis/npm/libnpmconfig.svg)](https://travis-ci.org/npm/libnpmconfig) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/libnpmconfig?svg=true)](https://ci.appveyor.com/project/zkat/libnpmconfig) [![Coverage Status](https://coveralls.io/repos/github/npm/libnpmconfig/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmconfig?branch=latest)
2
3[`libnpmconfig`](https://github.com/npm/libnpmconfig) is a Node.js library for
4programmatically managing npm's configuration files and data.
5
6## Example
7
8```js
9const config = require('libnpmconfig')
10
11console.log('configured registry:', config.read({
12  registry: 'https://default.registry/'
13}))
14// => configured registry: https://registry.npmjs.org
15```
16
17## Install
18
19`$ npm install libnpmconfig`
20
21## Table of Contents
22
23* [Example](#example)
24* [Install](#install)
25* [API](#api)
26
27### API
28
29##### <a name="read"></a> `> read(cliOpts, builtinOpts)`
30
31Reads configurations from the filesystem and the env and returns a
32[`figgy-pudding`](https://npm.im/figgy-pudding) object with the configuration
33values.
34
35If `cliOpts` is provided, it will be merged with the returned config pudding,
36shadowing any read values. These are intended as CLI-provided options. Do your
37own `process.argv` parsing, though.
38
39If `builtinOpts.cwd` is provided, it will be used instead of `process.cwd()` as
40the starting point for config searching.
41