# loadrc

> Load runtime configuration files for your module.

Latest version **1.0.0** (published 2016-04-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install loadrc
pnpm add loadrc
yarn add loadrc
bun add loadrc
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score; declining downloads.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-04-12 |
| First published | 2016-04-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | bubkoo |
| Maintainers | bubkoo |
| Keywords | load, configuration, config, rc, package, module, dotfile, dot, runtime |

## Links

- npm: https://www.npmjs.com/package/loadrc
- Repository: https://github.com/bubkoo/loadrc
- Homepage: https://github.com/bubkoo/loadrc#readme
- Issues: https://github.com/bubkoo/loadrc/issues
- npm.io page: https://npm.io/package/loadrc

## Dependencies (3)

- [js-yaml](https://npm.io/package/js-yaml.md) ^3.5.5
- [path-is-absolute](https://npm.io/package/path-is-absolute.md) ^1.0.0
- [strip-json-comments](https://npm.io/package/strip-json-comments.md) ^2.0.1

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-04-12
- 0.1.4 — 2016-04-03
- 0.1.3 — 2016-04-03
- 0.1.2 — 2016-04-02
- 0.1.1 — 2016-04-02
- 0.1.0 — 2016-04-02
- 0.0.1 — 2016-04-02

## README

# loadrc 

> Load runtime configuration files for your module.

[![MIT License](https://img.shields.io/badge/license-MIT_License-green.svg?style=flat-square)](https://github.com/bubkoo/loadrc/blob/master/LICENSE) 

Many NodeJS modules have `**rc**` [files](http://stackoverflow.com/questions/11030552/what-does-rc-mean-in-dot-files), such as `.babelrc`, `.eslintrc.yml`, etc. 

Use `loadrc` to parse your `rc` files into JavaScript object.

**Supported files:**

- JavaScript Module
- Yaml file
- JSON file
- Legacy file, such as `.config`
- package.json


`loadrc` will try to load these files by the listed order, stop **until** any of them loaded.

 
## Install

```
$ npm install loadrc --save
```

## Usage

```js
var loadrc = require('loadrc');
var config = loadrc.load(basename, rootDir);

// example
// -------
// try to load these files order by order: 
// - .congifrc.js
// - .congifrc.yaml
// - .congifrc.yml
// - .congifrc.json
// - .congifrc
// - load "package.json" and return "config" section
var config = loadrc.load('configrc');
```

# Contributing
 
Pull requests and stars are highly welcome. 

For bugs and feature requests, please [create an issue](https://github.com/bubkoo/loadrc/issues).

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