# fc-config

> ## Installation ``` # Use npm npm install fc-config

Latest version **0.13.0** (published 2022-11-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install fc-config
pnpm add fc-config
yarn add fc-config
bun add fc-config
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.13.0 |
| Published | 2022-11-15 |
| First published | 2022-11-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | fang |
| Maintainers | fangqk1991 |

## Links

- npm: https://www.npmjs.com/package/fc-config
- Repository: https://github.com/fangqk1991/node-config
- Homepage: https://github.com/fangqk1991/node-config#readme
- Issues: https://github.com/fangqk1991/node-config/issues
- npm.io page: https://npm.io/package/fc-config

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.17.21

## Recent versions

- 0.13.0 (latest) — 2022-11-15
- 0.12.0 — 2022-11-10
- 0.11.0 — 2022-11-07
- 0.10.0 — 2022-11-07

## README

# fc-config

## Installation
```
# Use npm
npm install fc-config

# Or use yarn
yarn add fc-config
```

## Prepare
Create `config/default.js`

```
module.exports = {
  Env: 'It will be rewritten by process.env.NODE_CONFIG_ENV or process.env.NODE_ENV',
  prop1: 123,
  prop2: 'abc',
  ……
}
```

## Usage
```
import { GlobalAppConfig } from 'fc-config'

...
```

## Tips
1. `Env`'s default value is `development`
2. `./config/${env}.js` will be the `EnvConfigFile` 
3. `process.env.NODE_CONFIG_EXTRA_JS` will be the `ExtrasConfigFile`, it should use absolute-path
4. `process.env.ENV_CONFIG_DATA` will be the `RuntimeConfig`, it should be a JSON-string.
5. **Merge Priority**: `RuntimeConfig` > `ExtrasConfigFile` > `EnvConfigFile` > `default.js`

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