# read-package-config

> Read the configuration of any package using its directory or name.

Latest version **1.0.2** (published 2017-10-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install read-package-config
pnpm add read-package-config
yarn add read-package-config
bun add read-package-config
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2017-10-18 |
| First published | 2017-10-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | laino |
| Maintainers | laino |

## Links

- npm: https://www.npmjs.com/package/read-package-config
- Repository: https://github.com/Volafile/read-package-config
- Issues: https://github.com/Volafile/read-package-config/issues
- npm.io page: https://npm.io/package/read-package-config

## Dependencies (1)

- [ini](https://npm.io/package/ini.md)

## Recent versions

- 1.0.2 (latest) — 2017-10-18
- 1.0.1 — 2017-10-18
- 1.0.0 — 2017-10-18

## README

package-config
==============

Simply read the configuration of any package. Optionally also reading a package.json.

Config files read:

    - directory/package.json (if a directory is given),
    - directory/npmrc       (if a directory is given),
    - `globalConfig` (Default: /etc/npmrc),
    - `userConfig` (Default: ~/.npmrc)

Doesn't read npm's built-in config file.

Usage:

```js

const readConfig = require('read-package-config');

const config = await readConfig({
    name: 'my-package',     // Packages can be identified by name...
    directory: './',        // or directory. In which case its package.json and .npmrc will also be read.

                                // Optional arguments:
    globalConfig: '/etc/npmrc', // Location of npm's global configuration
    userConfig: os.homedir() + '/.npmrc',     // Location of npm's per-user configuration
});

console.log(config); // { key: value, ... }

```

---
_Source: https://npm.io/package/read-package-config · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
