merge-yaml-cli
Version:
CLI utility for merging YAML files
33 lines (20 loc) • 1.43 kB
Markdown
# merge-yaml-cli
[](https://snyk.io/test/github/brainsiq/merge-yaml-cli/ac54a80e5f7f1648aecc380c7aea470f49f1ccef) [](http://standardjs.com/)
[](https://circleci.com/gh/brainsiq/merge-yaml-cli/tree/master)
[](https://nodei.co/npm/merge-yaml-cli/)
Merges YAML files together using [glob](https://www.npmjs.com/package/glob) patterns to specify input files, with a CLI to
write out the result as a file.
#### Usage
```shell
npm i -g merge-yaml-cli
merge-yaml -i example.yaml includes/*.yml -o merged.yml
```
#### Node.js API
```
const mergeYaml = require('merge-yaml-cli')
mergeYaml.on('files', console.log('Files found: ', files))
const result = mergeYaml.merge(['example.yml', 'includes/*.yml'])
```
#### Tests
The repo contains one simple test case. `tests/base.yml` is merged with `includes/*.yml` and the output is compared with `expected.yml`.
The test can be run with `yarn test` or `npm test` but requires Docker and Docker Compose to be installed.