Crates.io | yaml2json-rs |
lib.rs | yaml2json-rs |
version | 0.4.0 |
source | src |
created_at | 2020-11-15 14:52:00.989523 |
updated_at | 2022-09-22 16:36:56.255119 |
description | Convert YAML documents to JSON |
homepage | https://github.com/Nessex/yaml2json-rs/blob/master/crates/yaml2json-rs |
repository | https://github.com/Nessex/yaml2json-rs |
max_upload_size | |
id | 312587 |
size | 7,962 |
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.
let yaml = r#"
hello: world
"#;
let yaml2json = Yaml2Json::new(Style::PRETTY);
let json = yaml2json.document_to_string(yaml);
println!("{}", json);