Crates.io | smoljson |
lib.rs | smoljson |
version | 0.1.1 |
source | src |
created_at | 2020-12-06 19:29:02.693297 |
updated_at | 2021-07-05 08:06:33.91 |
description | Minimal |
homepage | https://github.com/thomcc/smoljson |
repository | https://github.com/thomcc/smoljson |
max_upload_size | |
id | 320205 |
size | 81,547 |
smoljson
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.
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);
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.