{"id":19320252,"url":"https://github.com/jlyonsmith/json5-nodes","last_synced_at":"2025-07-06T12:04:02.097Z","repository":{"id":62441397,"uuid":"430897602","full_name":"jlyonsmith/json5-nodes","owner":"jlyonsmith","description":"Parse JSON5 into an AST with line/column information.","archived":false,"fork":false,"pushed_at":"2022-03-06T00:55:45.000Z","size":35,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-09T07:10:04.486Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jlyonsmith.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-22T23:33:27.000Z","updated_at":"2023-07-18T19:50:32.000Z","dependencies_parsed_at":"2022-11-01T22:02:00.374Z","dependency_job_id":null,"html_url":"https://github.com/jlyonsmith/json5-nodes","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlyonsmith%2Fjson5-nodes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlyonsmith%2Fjson5-nodes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlyonsmith%2Fjson5-nodes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlyonsmith%2Fjson5-nodes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jlyonsmith","download_url":"https://codeload.github.com/jlyonsmith/json5-nodes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223902660,"owners_count":17222408,"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","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":[],"created_at":"2024-11-10T01:28:00.150Z","updated_at":"2024-11-10T01:28:00.698Z","avatar_url":"https://github.com/jlyonsmith.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json5_nodes\n\nThis Rust library parses JSON5 into `JsonNode` structures that contain both the JSON value and the location of the data in the original string. This allows you to use JSON5 as a configuration format and refer back to the location of semantic errors in the original JSON5 as opposed to just reporting syntactic errors when reading the file.\n\nSee the [`stampver-rs`](https://github.com/jlyonsmith/stampver-rs) tool for an example of how to use the library.\n\n## Implementation\n\nWe use [`IndexHashMap`](https://crates.io/crates/hashlink) instead of a plain [`HashMap`](https://doc.rust-lang.org/std/collections/struct.HashMap.html) because JavaScript [mostly preserves the order of insertion into objects](https://stackoverflow.com/a/38218582). This libraries JSON5 parser currently only allows string based keys, so the rules are simplified.\n\nAll JSON breaks down into nodes of different types, `JsonNode::Null`, `JsonNode::String`, `JsonNode::Bool`, `JsonNode::Integer`, `JsonNode::Float`, `JsonNode::Array` and `JsonNode::Object`.  We define and parse two types of numbers because it's more important in statically typed languages to specifically pick one or the other.\n\n## To Do\n\nThis library is a work in progress.  The following are some things that still need to be done:\n\n- [ ] Get closer to 100% code coverage with the unit tests.\n- [ ] Rewrite the hex conversions to avoid the pathological `Err` cases; the values are already parsed to be valid input.\n- [ ] Maybe ensure that what's read by `parse` can be written back out in `stringify` with full fidelity.  In particular escape codes are not handled at all and hex numbers don't round-trip.\n- [ ] A better README!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlyonsmith%2Fjson5-nodes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjlyonsmith%2Fjson5-nodes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlyonsmith%2Fjson5-nodes/lists"}