# @codecat/config

> Configuration handling for projects.

Latest version **2.1.3** (published 2019-09-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @codecat/config
pnpm add @codecat/config
yarn add @codecat/config
bun add @codecat/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 | 2.1.3 |
| Published | 2019-09-17 |
| First published | 2019-09-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 10.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mateusz Russak |
| Maintainers | codecat |

## Links

- npm: https://www.npmjs.com/package/@codecat/config
- npm.io page: https://npm.io/package/@codecat/config

## Dependencies (3)

- [mime](https://npm.io/package/mime.md) ^2.4.4
- [yaml](https://npm.io/package/yaml.md) ^1.6.0
- [bluebird](https://npm.io/package/bluebird.md) ^3.5.5

## Recent versions

- 2.1.3 (latest) — 2019-09-17
- 2.1.2 — 2019-09-05
- 2.1.1 — 2019-09-05
- 2.1.0 — 2019-09-03
- 2.0.1 — 2019-09-03
- 2.0.0 — 2019-09-03
- 1.1.0 — 2019-09-03
- 1.0.0 — 2019-09-03

## README

# @codecat/config
Configuration handling for projects.

#### Features
* Ability to load nested config files
* Ability to put ENV variables to in JSON and YAML
* Validation of loaded config file with use of `@hapi/joi`
* Resolving paths relative to config files

#### Usage
`configFile.yml` 
```yaml
port: 9000
```
`app.js`
```javascript
const ConfigLoader = require('@codecat/config');
const Joi = require('@hapi/joi');

const schema = Joi.object().keys({
  port: Joi.number().port().default(8000)
});

const config = ConfigLoader(schema).load('./configFile.yml');

console.log(config.port); // 9000
```

Currently YAML, JSON and JS files are supported.

#### TODO
[ ] ability to add more file loaders for different mime-types  
[ ] ability to define custom directives  
[ ] write some more info in README

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