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
117,236 downloads per month
Used in 229 crates
(10 directly)
17KB
193 lines
JSON Strip Comments
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