json2yaml
Convert between JSON and YAML in CLI
Installation
$ gem install json2yaml
Usage
Now, you can use json2yaml
and yaml2json
Read from STDIN
$ echo '{ "a" : 123 }' | json2yaml
#=>
---
a: 123
$ echo 'a: 123' | yaml2json
#=>
{"a":123}
$ cat foo.json | json2yaml > foo.yml
$ cat bar.yml | yaml2json > bar.json
Read from files
$ json2yaml log1.json log2.json > log.yaml
$ yaml2json log1.yaml log2.yaml > log.json
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request