#yaml #json

yaml2json-rs

Convert YAML documents to JSON

10 releases

0.4.0 Sep 22, 2022
0.3.2 Sep 7, 2021
0.3.1 Jul 25, 2021
0.2.8 Dec 20, 2020
0.2.7 Nov 17, 2020

#484 in Encoding

Download history 2/week @ 2022-11-27 5/week @ 2022-12-04 7/week @ 2022-12-11 5/week @ 2022-12-18 16/week @ 2022-12-25 2/week @ 2023-01-01 7/week @ 2023-01-08 4/week @ 2023-01-15 7/week @ 2023-01-22 16/week @ 2023-01-29 16/week @ 2023-02-05 13/week @ 2023-02-12 27/week @ 2023-02-19 8/week @ 2023-02-26 6/week @ 2023-03-05 22/week @ 2023-03-12

63 downloads per month
Used in yaml2json-rs-bin

Apache-2.0 OR MIT

8KB
108 lines

yaml2json-rs

yaml2json-rs is a library which helps to convert YAML document strings to JSON. Output can be returned as a string, or passed on to anything that implements io::Write.

This library is a thin wrapper around serde-yaml and serde-json.

Usage

let yaml = r#"
hello: world
"#;

let yaml2json = Yaml2Json::new(Style::PRETTY);
let json = yaml2json.document_to_string(yaml);

println!("{}", json);

Dependencies

~2.2–3MB
~70K SLoC