# @copropr/config-plugin

> A configuration plugin that sets up config tools with given option

Latest version **1.0.1** (published 2018-08-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install @copropr/config-plugin
pnpm add @copropr/config-plugin
yarn add @copropr/config-plugin
bun add @copropr/config-plugin
```

## 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 | 1.0.1 |
| Published | 2018-08-03 |
| First published | 2018-04-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 (+16 in 2 direct dependencies) |
| Install scripts | no |
| Author | copropr |
| Maintainers | cmseguin |
| Keywords | yaml, yml, config, plugin, copropr, tools |

## Links

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

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) 4.17.10
- [js-yaml](https://npm.io/package/js-yaml.md) 3.12.0

## Alternatives

- [monaco-yaml](https://npm.io/package/monaco-yaml.md) — 420.1K weekly downloads
- [@crewx/workflow](https://npm.io/package/@crewx/workflow.md) — 3.1K weekly downloads
- [yaml-cat](https://npm.io/package/yaml-cat.md) — 38 weekly downloads
- [nunjucks-in-yaml](https://npm.io/package/nunjucks-in-yaml.md) — 9 weekly downloads
- [shopify-symlinks](https://npm.io/package/shopify-symlinks.md) — 3 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2018-08-03
- 0.0.4 (next) — 2018-04-16
- 1.0.0 — 2018-07-27
- 0.0.7 — 2018-05-30
- 0.0.6 — 2018-05-30
- 0.0.5 — 2018-04-16
- 0.0.2 — 2018-04-10
- 0.0.1 — 2018-04-10

## README

Config Plugin
=============
#### This plugin lets you load yml files as configs in your projects

## Installation
```bash
# NPM
$ npm i -S @copropr/config-plugin

# Yarn
$ yarn add @copropr/config-plugin
```

## Usage
```javascript
// Commonjs
const ConfigPlugin = require('@copropr/config-plugin').default

// ES6 module way
import ConfigPlugin from '@copropr/config-plugin'

const conf = new ConfigPlugin([
  'path/to/your/config.yml'
])
```

The constructor expect an array of path [string] or object containing:
+ path: [string] The path of the file relative to project root
+ throw: [boolean] If it should throw an exception in case the file is not found

The files will be loaded in the order you set, so the second file will always overwrite the first, and so on...

***Note:** Don't forget to use `.default` if using es5 modules*

## API

### get method
The get method is a proxy to the lodash [get function](https://lodash.com/docs/4.17.10#get) without specifying the object
#### example:
```javascript
conf.get('var1.nestedvar', defaultValue)
```

### wholeConfig (getter)
This getter will return the whole config object
#### example:
```javascript
const configObject = conf.wholeConfig
```

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