1 post tagged

yaml

you need to have ruby installed which is always true for macOS.

function yaml2json()
{
    ruby -ryaml -rjson -e \
         'puts JSON.pretty_generate(YAML.load(ARGF))' $*
}

usage:

yaml2json my.yml
jsonyaml