Documentation
  • Coverage
  • 9.9%
    10 out of 101 items documented1 out of 84 items with examples
  • Size
  • Source code size: 81.17 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 6.68 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • thomcc/smoljson
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • thomcc

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.