• Home
Name Date Size #Lines LOC

..--

benches/04-Jul-2025-122111

examples/04-Jul-2025-2117

src/04-Jul-2025-572396

.android-checksum.jsonD04-Jul-20251.1 KiB11

.cargo-checksum.jsonD04-Jul-2025748 11

Android.bpD04-Jul-2025909 3329

Cargo.lockD04-Jul-202511 KiB404353

Cargo.tomlD04-Jul-2025941 3730

LICENSED04-Jul-20251 KiB2217

METADATAD04-Jul-2025409 1817

MODULE_LICENSE_MITD04-Jul-20250

README.mdD04-Jul-2025980 4030

cargo_embargo.jsonD04-Jul-202529 33

rust-toolchain.tomlD04-Jul-202551 43

README.md

1# JSON Strip Comments
2
3[![Crates.io][crates-badge]][crates-url]
4[![Docs.rs][docs-badge]][docs-url]
5
6[crates-badge]: https://img.shields.io/crates/d/json-strip-comments?label=crates.io
7[crates-url]: https://crates.io/crates/json-strip-comments
8[docs-badge]: https://img.shields.io/docsrs/json-strip-comments
9[docs-url]: https://docs.rs/json-strip-comments
10
11A fork of a fork for stripping JSON comments and trailing commas in place:
12
13* https://github.com/tmccombs/json-comments-rs
14* https://github.com/parcel-bundler/parcel/pull/9032
15
16## Example
17
18```rust
19use serde_json::Value;
20
21fn main() {
22    let mut data = String::from(
23        r#"
24     {
25         "name": /* full */ "John Doe",
26         "age": 43,
27         "phones": [
28             "+44 1234567", // work phone
29             "+44 2345678", // home phone
30         ]
31     }"#,
32    );
33
34    json_strip_comments::strip(&mut data).unwrap();
35    let value: Value = serde_json::from_str(&data).unwrap();
36
37    println!("{value}");
38}
39```
40