2 releases

0.1.1 Jul 5, 2021
0.1.0 Dec 6, 2020

#1804 in Encoding

Download history 8/week @ 2023-12-04 24/week @ 2023-12-11 74/week @ 2023-12-18 5/week @ 2023-12-25 17/week @ 2024-01-01 22/week @ 2024-01-08 32/week @ 2024-01-15 88/week @ 2024-01-22 29/week @ 2024-01-29 53/week @ 2024-02-05 69/week @ 2024-02-12 113/week @ 2024-02-19 70/week @ 2024-02-26 59/week @ 2024-03-04 121/week @ 2024-03-11 107/week @ 2024-03-18

360 downloads per month

Apache-2.0 OR MIT OR Zlib

56KB
1.5K SLoC

smoljson

Build Status Docs Latest Version

This is a minimalist JSON library that trades away several desirable qualities (ergonomics, performance, ...) in favor of small code size and fast compiles.

It doesn't support serde, or any other custom derive. I'm not particularly happy with the API, and will likely change it to be better in the future. As a result, docs are somewhat sparse.

Basic usage

use smoljson::Value;
let v = Value::from_str(r#"{"foo": [1, 2, {"bar": 3}]}"#).unwrap();
let expected = smoljson::json!({"foo": [1, 2, {"bar": 3}]});
assert_eq!(v, expected);

JSON with Comments (CJSON) support

By default, strictly correct JSON is required, which excludes comments. However, the crate and parsers can be configured to support parsing JSON that contains JavaScript-style comments (AKA CJSON).

See the documentation for more info.

No runtime deps

Features