#toml #yaml #json-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

#32 in #json-toml

Download history 1/week @ 2024-06-18 2/week @ 2024-07-23 3/week @ 2024-07-30

369 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–3.5MB
~71K SLoC