yaml-include
Adds a custom tag for a YAML document that facilitate inclusion and merging of external .yaml
files.
Installation
$ npm install yaml-files
CLI Usage
$ npm install -g yaml-files$ yaml-files -hUsage: yaml-files <input_filename> <output_filename> [options] input_filename: path to yml file being parsed output_filename: path to save the yml file --help, -h show help
Library Usage
Merge
Merge multiple yaml files with lodash merge.
file1.yml
key1: my key in file1array: - array1
file2.yml
key2: my key in file2array: - array2
main.yml
myDocument: key1: myKey key2: !!files_merge ['file1.yml', 'file2.yml']
Merge with Append
Merge multiple yaml files with lodash merge with arrays appended
file1.yml
key1: my key in file1array: - array1
file2.yml
key2: my key in file2array: - array2
main.yml
myDocument: key1: myKey key2: !!files_merge_append ['file1.yml', 'file2.yml']
index.js
const yaml = ;const yamlfiles = ;const fs = ; const src = fs; const obj = yaml;