yamla

1.0.3 • Public • Published

yamla

YAML Aggregator that bundles large yaml files from directory structure and unbundle to a directory structure

Problem

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

Solution

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

Installation

With npm:

npm install --save yamla

With yarn:

yarn add -D yamla

Usage

Bundle

npm run bundle <folder>

option('-o, --outfile ', 'The output file') option('-j, --json', 'Output JSON(Default is YAML)')

Unbundle

npm run unbundle <file.(yaml|json)>

option('-o, --outdir ', 'The output folder')

Contributing

All contributions are welcomed

License

MIT

Credits

Inspired from the work done by people at https://github.com/Redocly/swagger-repo

Package Sidebar

Install

npm i yamla

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

42.2 kB

Total Files

9

Last publish

Collaborators

  • anshu_das