YAML Aggregator that bundles large yaml files from directory structure and unbundle to a directory structure
YAML is a great format that is both machine readable and easy for human comprehension. However there may be cases where the YAML file is large and can be structured as a bunch of files and folders. Also sometimes we may want to bundle the contents of a folder structure into an YAML
This tool splits YAML file as follows (joins also using same logic)
- In the target folder create one yaml file of the original file name
- properties with single line texts and native values saved in same yaml file
- multiline texts saved as .md files
- properties that are arrays of objects are converted to folders
- properties that are objects and contain multiline texts, arrays or objects are converted to folders
With npm:
npm install --save yamla
With yarn:
yarn add -D yamla
npm run bundle <folder>
option('-o, --outfile ', 'The output file') option('-j, --json', 'Output JSON(Default is YAML)')
npm run unbundle <file.(yaml|json)>
option('-o, --outdir ', 'The output folder')
All contributions are welcomed
Inspired from the work done by people at https://github.com/Redocly/swagger-repo