c12-parser 1.1.0

Toolbox for parsing and stringifying various formats, including JSON, JSON5, JSONC, INI, TOML, and YAML.
Documentation
//! Minimal example: parse JSON and stringify it back with preserved formatting.

use c12_parser::{parse_json, stringify_json};
use serde_json::Value;

fn main() {
    let text = r#"
{
  "name": "c12-parser",
  "version": "1.0.0"
}
"#;

    let formatted = parse_json::<Value>(text, None).expect("parse");
    println!(
        "Parsed value: {} {}",
        formatted.value["name"], formatted.value["version"]
    );

    let out = stringify_json(&formatted, None).expect("stringify");
    println!("Roundtrip output:\n{}", out);
}