{"id":30626947,"url":"https://github.com/master-hax/lil-json","last_synced_at":"2025-08-30T19:06:22.027Z","repository":{"id":310455585,"uuid":"1039900479","full_name":"master-hax/lil-json","owner":"master-hax","description":"lil rust crate to serialize \u0026 deserialize JavaScript Object Notation (JSON) - #[no_std] compatible","archived":false,"fork":false,"pushed_at":"2025-08-26T06:18:25.000Z","size":74,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-26T06:22:44.665Z","etag":null,"topics":["embedded","heapless","json","nostd","nostdlib","parser","rust","serialization"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/lil-json","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/master-hax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-18T06:44:36.000Z","updated_at":"2025-08-26T06:18:28.000Z","dependencies_parsed_at":"2025-08-18T08:53:40.178Z","dependency_job_id":"d2b3ff5c-c6c5-4c1a-acbf-480e16561cf6","html_url":"https://github.com/master-hax/lil-json","commit_stats":null,"previous_names":["master-hax/lil-json"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/master-hax/lil-json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/master-hax%2Flil-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/master-hax%2Flil-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/master-hax%2Flil-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/master-hax%2Flil-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/master-hax","download_url":"https://codeload.github.com/master-hax/lil-json/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/master-hax%2Flil-json/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272892852,"owners_count":25010854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded","heapless","json","nostd","nostdlib","parser","rust","serialization"],"created_at":"2025-08-30T19:06:16.656Z","updated_at":"2025-08-30T19:06:22.005Z","avatar_url":"https://github.com/master-hax.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lil-json\n\nlil `#![no_std]` Rust crate to parse \u0026 serialize JavaScript Object Notation (JSON). alloc optional. std optional.\n\nonly 2 required dependencies + 2 optional dependencies:\n1. [embedded-io](https://crates.io/crates/embedded-io) (required) for `#![no_std]` friendly `Write` trait\n1. [numtoa](https://crates.io/crates/numtoa) (required) for converting numbers into base 10 ascii\n1. [elsa](https://crates.io/crates/elsa) (optional with `alloc` feature enabled) for implementing an infinite length string escape buffer\n1. [embedded-io-adapters](https://crates.io/crates/embedded-io-adapters) (optional with `std` feature enabled) for translating `embedded_io::Write` to `std::io::Write`\n\nJSON can be serialized into any type that implements [`embedded_io::Write`](https://docs.rs/embedded-io/latest/embedded_io/trait.Write.html) or a `String` (with `alloc` feature enabled). Take a look at the [documentation](https://docs.rs/lil-json/latest/lil_json/).\n\nHere is a minimal example of printing JSON object to stdout with a one-liner (making use of `lil-json::FieldBuffer`, `core::convert::From for JsonValue`, \u0026 `core::convert::Into for JsonField`):\n```rust\nuse lil_json::FieldBuffer;\n\nfn main() {\n    println!(\n        \"{}\",\n        [\n            (\"some_number\", 12345).into(),\n            (\"some_string\", \"hello world!\").into(),\n            (\"some_boolean\", true).into()\n        ].as_json_object()\n    );\n}\n\n// output: {\"some_number\":12345,\"some_string\":\"hello world!\",\"some_boolean\":true}\n```\n\nHere is an example of parsing a JSON object\n```rust\nuse lil_json::{ArrayJsonObject, JsonField, JsonValue};\n\nfn main() {\n    const SERIALIZED_DATA: \u0026[u8] = br#\"{\"some_string_key\":\"some_string_value}\"#;\n    let mut escape_buffer = [0_u8; 100];\n    let (bytes_consumed,json_object) = ArrayJsonObject::\u003c1\u003e::new_parsed(\n        SERIALIZED_DATA,\n        escape_buffer.as_mut_slice()\n    ).unwrap();\n    assert_eq!(SERIALIZED_DATA.len(), bytes_consumed);\n    let parsed_fields = json_object.fields();\n    assert_eq!(1, parsed_fields.len());\n    assert_eq!(JsonField::new(\"some_string_key\", JsonValue::String(\"some_string_value\")), parsed_fields[0]);\n}\n\n```\n\nHere is an example of parsing a JSON object with the alloc feature enabled - no need to pre-allocate space for the fields or escaped strings:\n```rust\nuse lil_json::{JsonField, JsonObject, JsonValue, InfiniteEscapeBuffer};\n\nfn main() {\n    const SERIALIZED_DATA: \u0026[u8] = br#\"{\"some_string_key\":\"some_string_value\"}\"#;\n    let mut json_object = JsonObject::wrap(Vec::new());\n    let mut infinite_escape_buffer = InfiniteEscapeBuffer::new();\n    // parse_alloc is enabled by using wrapping a Vec and providing a mutable reference to an InfiniteEscapeBuffer\n    let bytes_consumed = json_object.parse_alloc(SERIALIZED_DATA, \u0026mut infinite_escape_buffer).unwrap();\n    assert_eq!(SERIALIZED_DATA.len(), bytes_consumed);\n    let parsed_fields = json_object.fields();\n    assert_eq!(1, parsed_fields.len());\n    assert_eq!(JsonField::new(\"some_string_key\", JsonValue::String(\"some_string_value\")), parsed_fields[0]);\n}\n```\n\nCheck out the examples for more. Still a work in progress. Expect bugs \u0026 breaking API changes. Check out the examples to get started.\n\nthe following types are currently supported:\n* objects (currently limited to non-nested types)\n* string (currently limited to ascii-)\n* boolean\n* null\n* number (currently limited to integers)\n\nthe following types are not currently supported:\n* arrays (currently limited to non-nested types)\n\nTODO:\n- [x] support null type\n- [ ] support floating point numbers\n- [x] alloc features\n- [x] expose serialization methods for terminal types\n- [x] support arrays\n- [ ] support [arbitrary](https://crates.io/crates/arbitrary) crate\n- [ ] support parsing arbitrary types\n- [ ] support unicode escape sequences\n- [ ] support buffered serialization\n- [ ] support parsing from stream\n- [ ] support parsing streaming objects/arrays\n- [ ] support escaping user-configurable unicode characters\n- [ ] support embedded-io-async?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaster-hax%2Flil-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaster-hax%2Flil-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaster-hax%2Flil-json/lists"}