# fileconfig

> json and yml file configurations

Latest version **4.0.0** (published 2019-12-07) · Apache-2.0 license · 0 weekly downloads

## Install

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

## 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 | 4.0.0 |
| Published | 2019-12-07 |
| First published | 2015-02-13 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 35 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Hasnae R. |
| Maintainers | viqueen |
| Keywords | json, yml, config |

## Links

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

## Dependencies (3)

- [yamljs](https://npm.io/package/yamljs.md) ^0.3.0
- [jsonfile](https://npm.io/package/jsonfile.md) ^5.0.0
- [harmony-reflect](https://npm.io/package/harmony-reflect.md) ^1.4.2

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 4.0.0 (latest) — 2019-12-07
- 3.2.0 — 2016-02-19
- 3.1.0 — 2016-01-24
- 3.0.0 — 2016-01-06
- 2.0.0 — 2015-04-30
- 1.0.6 — 2015-04-23
- 1.0.5 — 2015-04-22
- 1.0.4 — 2015-04-13
- 1.0.3 — 2015-04-11
- 1.0.2 — 2015-04-08
- 1.0.1 — 2015-04-07
- 1.0.0 — 2015-04-05
- 0.1.1 — 2015-02-23
- 0.1.0 — 2015-02-13

## README

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=fileconfig&metric=alert_status)](https://sonarcloud.io/dashboard?id=fileconfig)

# fileconfig (v-4.0.0)

Library for configuration file loading

## install it

```bash
npm install fileconfig -g
```

## use it

assuming you have a configuration folder as follow:

```
+ /path/to/config/folder
    + share
        default.yml -> symlink to dev/alpha.yml
        + qa
        + dev
            alpha.yml
```

with this content

- share/dev/alpha.yml

```yaml
name: "alpha dev share"
port: 9090
dir: ${env.ALPHA_SHARE}
```

then you can fetch data as follow:

```javascript
var FileConfig = require("fileconfig");
var config = new FileConfig("/path/to/config/folder");

var defaultServer = config.share.default;
console.log(defaultServer.name); // out : alpha dev share
console.log(defaultServer.port); // out : 9090
```

## dev

```
npm run test:watch          # run tests and watch for changes
npm run lint                # generate lint report
```

## licence

Apache-2.0

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