A trivial script to convert JSON to YAML.
Pipe to stdin:
echo '{"foo": 42}' | json2yaml
Or pass in a file parameter:
json2yaml /path/to/baz.json
You can also create a bash alias into your $HOME/.bash_aliases and run it like an alias, or use directly the docker commands.
The corresponding YAML will be written to standard out.
A trivial script to convert YAML to JSON.
Pipe to stdin:
echo 'Foo: 42' | yaml2json
Or pass in a file parameter:
yaml2json /path/to/baz.yml
You can also create a bash alias into your $HOME/.bash_aliases and run it like an alias, or use directly the docker commands.
The corresponding JSON will be written to standard out.
Requires you to install Python3 and PyYAML locally or docker.
You can use it with:
- docker and the provided dockerfile
- virtual environment (using requirements.txt), or locally by installing PyYAML through pip.
Aaron Maxwell - http://redsymbol.net
https://gist.github.com/oglops/c70fb69eef42d40bed06
Public domain