fmtcnv 2.3.3

Cross-convert bson, csv, hjson, hocon, json, json5, jsonl, plist, ron, toml, toon, xml, yaml
Documentation

fmtcnv 2.3.3

version build coverage dependencies docs license downloads

This crate 'fmtcnv' is the continuation of crate 'convfmt' which uses the unmaintained and outdated crate 'hocon' (replaced here with 'hocon_')

The command line tool fmtcnv converts between these formats:

Usage

fmtcnv 2.3.3 - Cross-convert bson, csv, hjson, hocon, json, json5, jsonl, plist, ron, toml, toon, xml, yaml
Convert formats from stdin to stdout. Repo: github.com/pepa65/fmtcnv
Usage: fmtcnv [OPTIONS] --from <FROM> --to <TO>
Options:
  -f, --from <FROM>  [possible values: bson, csv, hjson, hocon, json, json5, jsonl, plist, ron, toml, toon, xml, yaml]
  -t, --to <TO>      [possible values: bson, csv, hjson, hocon, json, json5, jsonl, plist, ron, toml, toon, xml, yaml]
  -c, --compact      Compact output as much as possible [default: false]
  -h, --help         Print help
  -V, --version      Print version

Examples

cat cfg.yml |fmtcnv -f yaml -t toml >cfg.toml
fmtcnv -f json -t json <compact.json >pretty.json
curl https://api.github.com/users/pepa65 |fmtcnv -f json -t json5  # Output on stdout

Beware of null values, as some formats (toml!) don't support them.

Installation

  • Download latest binary
  • Install binary using cargo-binstall: cargo install cargo-binstall && cargo binstall fmtcnv
  • Build crate from crates.io with rust: cargo install fmtcnv
  • Build repo locally with rust:
git clone https://github.com/pepa65/fmtcnv
cd fmtcnv
cargo rel