9 stable releases

Uses new Rust 2024

3.1.0 Nov 21, 2025
3.0.1 Sep 15, 2025
2.0.0 Sep 15, 2025
1.0.4 Jul 21, 2024
1.0.1 Jan 19, 2024

#859 in Encoding

Download history 30169/week @ 2025-09-28 25751/week @ 2025-10-05 32096/week @ 2025-10-12 27273/week @ 2025-10-19 29669/week @ 2025-10-26 39556/week @ 2025-11-02 36536/week @ 2025-11-09 43049/week @ 2025-11-16 36894/week @ 2025-11-23 44305/week @ 2025-11-30 33797/week @ 2025-12-07 30788/week @ 2025-12-14 19995/week @ 2025-12-21 19501/week @ 2025-12-28 28162/week @ 2026-01-04 46857/week @ 2026-01-11

117,236 downloads per month
Used in 229 crates (10 directly)

MIT license

17KB
193 lines

JSON Strip Comments

Crates.io Docs.rs

A fork of a fork for stripping JSON comments and trailing commas in place:

Example

use serde_json::Value;

fn main() {
    let mut data = String::from(
        r#"
     {
         "name": /* full */ "John Doe",
         "age": 43, # hash line comment
         "phones": [
             "+44 1234567", // work phone
             "+44 2345678", // home phone
         ], /** comment **/
     }"#,
    );

    json_strip_comments::strip(&mut data).unwrap();
    let value: Value = serde_json::from_str(&data).unwrap();

    println!("{value}");
}

Dependencies

~240KB