js-yaml-import
Allows import files in YAML.
Requirements
This plugin requires an LTS Node version (v10.0.0+).
Install
Using npm:
$ npm i js-yaml js-yaml-import -D
Using yarn:
$ yarn add js-yaml js-yaml-import -D
Usage
Media:
Anime: foo
'@import':
- baz.yaml
Media:
VideoGames: bar
Media:
FilmAdaptation: baz
'@import':
- foo.yaml
- bar.yaml
Media:
Webcomic: aaa
Manga: bbb
const path = require('path');
const Yaml = require('js-yaml-import');
const yaml = new Yaml(path.join(__dirname, 'src'));
const yamlFile = yaml.read(path.join(__dirname, './src/data.yaml'));
console.log('data =', yamlFile);
Options
searchPaths
Type: string | string[]