Miss any of our Open RFC calls?Watch the recordings here! »

yaml-files

0.1.0 • Public • Published

yaml-include

CircleCI

Adds a custom tag for a YAML document that facilitate inclusion and merging of external .yaml files.

Installation

  $ npm install yaml-files

Usage

file1.yml

key1: my key in file1

file2.yml

key2: my key in file2

main.yml

myDocument:
  key1: myKey
  key2: !!files ['file1.yml', 'file2.yml']

index.js

const yaml = require('js-yaml');
const yamlfiles = require('yaml-files');
const fs = require('fs');
 
const src = fs.readFileSync('main.yml', 'utf8');
 
const obj = yaml.load(src, { schema: yamlfiles.YAML_FILES_SCHEMA });

Based On

Install

npm i [email protected]

Version

0.1.0

License

ISC

Last publish

Collaborators

  • avatar