Store large, unmanageable yaml files as multiple, manageable ones across your file system.
Dual-licensed under MIT or Apache-2.0
Before using this tool, you should know the basics of yaml.
fsyaml
allows you to split up your large yaml
files into multiple ones, and then easily compile them back into one file when needed.
For example, consider the following yaml:
yaml
a:
b: 1
c:
d:
e: 2
It could be restructured in your file system as:
root
├─a.yaml
└─c
└─d.yaml
Where a.yaml
is:
yaml
b: 1
and d.yaml
is:
yaml
e: 2
This allows you to separate out your file, and can make huge files much more maintainable.
If you want more examples, you can also look at the tests, which each contain a root directory and the expected.yaml
output.
Once you've set up your file system of yaml
files, you'll need to eventually combine them all back into one.
To do this, you'll install fsyaml
.
The easiest way is using cargo, which you can install by following these instructions.
bash
cargo install fsyaml
Once you've installed fsyaml
, you can use it like so:
bash
fsyaml path/to/root output.yaml
bash
fsyaml path/to/root > output.yaml
Disclaimer: This will not work on windows, and will output with UTF-16 LE encoding (Read more here)
This is a list of limitations to fsyaml
that are not currently supported. If you'd like to tackle one of them, feel free to open a pull request!