Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
node_modules/ | 12-May-2024 | - | 1,120 | 807 | ||
CHANGELOG.md | D | 12-May-2024 | 1.3 KiB | 52 | 22 | |
LICENSE | D | 12-May-2024 | 717 | 14 | 11 | |
PULL_REQUEST_TEMPLATE | D | 12-May-2024 | 183 | 8 | 0 | |
README.md | D | 12-May-2024 | 1.6 KiB | 41 | 27 | |
index.js | D | 12-May-2024 | 2.8 KiB | 108 | 97 | |
package.json | D | 12-May-2024 | 2 KiB | 67 | 66 |
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