convfmt is a command line tool which can convert between formats:
$ cat cfg.toml | convfmt -f toml -t yaml > cfg.yml
$ convfmt -f json -t json < compact.json > pretty.json
$ curl https://api.github.com/users/oriontvv | convfmt -f json -t json5 > api.json5
By default convfmt
uses pretty
format(can be disabled with --compact
option).
Beware of null
s, some formats don't support them (e.g. toml).
cargo install convfmt
This tool stands on the shoulders of such giants: