#json-toml #yaml #toml #json

markup-converter

A utility to convert YAML, TOML, and JSON files

2 unstable releases

0.2.0 Aug 15, 2022
0.1.0 Aug 9, 2022

#2975 in Parser implementations

38 downloads per month
Used in wick-cli

Apache-2.0

9KB
197 lines

markup-converter

A utility to convert between YAML, TOML, and JSON

Usage

Instantiate a new Transcoder instance with a JSON, YAML, or TOML path and use .to_json() or .to_yaml() to convert it to the specified format.

use markup_converter::Transcoder;

fn main() -> anyhow::Result<()> {
  let transcoder = Transcoder::from_path("tests/test.yaml")?;

  let json_val = transcoder.to_json()?;

  println!("{}", json_val);

  Ok(())
}

Dependencies

~2.3–3MB
~69K SLoC