#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

#42 in #json-toml

Download history 5/week @ 2024-07-29 12/week @ 2024-09-23

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
~72K SLoC