Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brainsiq/merge-yaml-cli
Node.js CLI utility for merging YAML files
https://github.com/brainsiq/merge-yaml-cli
cli node yaml
Last synced: 15 days ago
JSON representation
Node.js CLI utility for merging YAML files
- Host: GitHub
- URL: https://github.com/brainsiq/merge-yaml-cli
- Owner: brainsiq
- License: mit
- Created: 2016-10-05T13:45:20.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-09-09T06:31:56.000Z (2 months ago)
- Last Synced: 2024-10-28T14:53:44.534Z (23 days ago)
- Topics: cli, node, yaml
- Language: JavaScript
- Size: 353 KB
- Stars: 17
- Watchers: 3
- Forks: 2
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# merge-yaml-cli
[![Known Vulnerabilities](https://snyk.io/test/github/brainsiq/merge-yaml-cli/ac54a80e5f7f1648aecc380c7aea470f49f1ccef/badge.svg)](https://snyk.io/test/github/brainsiq/merge-yaml-cli/ac54a80e5f7f1648aecc380c7aea470f49f1ccef) [![Standard - JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](http://standardjs.com/)
[![CircleCI](https://circleci.com/gh/brainsiq/merge-yaml-cli/tree/master.svg?style=shield&circle-token=077fdc5153f1faebffa5e687a44369759c6a820d)](https://circleci.com/gh/brainsiq/merge-yaml-cli/tree/master)[![NPM](https://nodei.co/npm/merge-yaml-cli.png?downloads=true&downloadRank=true&stars=true)](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.