# ray-rc

> rc config

Latest version **1.0.1** (published 2021-05-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install ray-rc
pnpm add ray-rc
yarn add ray-rc
bun add ray-rc
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2021-05-24 |
| First published | 2021-05-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | ilex.h |
| Maintainers | ilex.h |
| Keywords | rc, file |

## Links

- npm: https://www.npmjs.com/package/ray-rc
- npm.io page: https://npm.io/package/ray-rc

## Dependencies (3)

- [js-yaml](https://npm.io/package/js-yaml.md) ^4.1.0
- [import-fresh](https://npm.io/package/import-fresh.md) ^3.3.0
- [strip-json-comments](https://npm.io/package/strip-json-comments.md) ^3.1.1

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2021-05-24
- 1.0.0 — 2021-05-24

## README

# ray-rc

xxrc 解析配置文件

## Usage

```js
const { ConfigFactory } = require('ray-rc');

const cf = new ConfigFactory({ appName: 'mf' });

const config = cf.loadFile(path.resolve(process.cwd(), '.mfrc'));
const config2 = cf.loadFile(path.resolve(process.cwd(), '.mfrc.yaml'));

// dir 读取文件顺序 '.mfrc.js', '.mfrc.cjs', '.mfrc.yaml', '.mfrc.yml', '.mfrc.json', '.mfrc', 'package.json'
const dirConfig = cf.loadDir();

console.log('mf：', config);
console.log('typeof：', typeof config);

console.log('mf2：', config2);

console.log('dirConfig：', dirConfig);
console.log('dirConfig typeof：', typeof dirConfig);
```

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