Created
June 7, 2019 12:52
-
-
Save aleofreddi/f800b25fe19e87f89d341ae29edcc36e to your computer and use it in GitHub Desktop.
one liner yaml2json & json2yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# yaml2json | |
ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF))' < hello.yaml | |
# json2yaml | |
ruby -ryaml -rjson -e 'puts YAML.dump(JSON.load(ARGF))' < hello.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment