{"id":13730307,"url":"https://github.com/quartzjer/js0n","last_synced_at":"2025-04-11T23:14:26.934Z","repository":{"id":50604729,"uuid":"930413","full_name":"quartzjer/js0n","owner":"quartzjer","description":"Flexible Zero-Footprint JSON Parser in C","archived":false,"fork":false,"pushed_at":"2024-11-18T18:48:05.000Z","size":42,"stargazers_count":340,"open_issues_count":2,"forks_count":49,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-04-11T23:14:22.746Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","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/quartzjer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2010-09-22T12:08:16.000Z","updated_at":"2025-03-27T18:14:58.000Z","dependencies_parsed_at":"2024-11-18T19:35:33.565Z","dependency_job_id":"d0da0de9-0770-402c-9ac3-1127a399fee1","html_url":"https://github.com/quartzjer/js0n","commit_stats":{"total_commits":45,"total_committers":8,"mean_commits":5.625,"dds":0.2666666666666667,"last_synced_commit":"d0ed04dbb02e5560fe0d685d0ea48a7ef8275f7f"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quartzjer%2Fjs0n","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quartzjer%2Fjs0n/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quartzjer%2Fjs0n/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quartzjer%2Fjs0n/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quartzjer","download_url":"https://codeload.github.com/quartzjer/js0n/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248492883,"owners_count":21113163,"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-08-03T02:01:13.085Z","updated_at":"2025-04-11T23:14:26.912Z","avatar_url":"https://github.com/quartzjer.png","language":"C","funding_links":[],"categories":["C","C++"],"sub_categories":[],"readme":"# js0n - Flexible Zero-Footprint JSON Parser in C\n\nA one-pass minimal overhead walk of the raw bytes, using each one as an index into a jump table to determine state transitions.\n\n* public domain or MIT license, single js0n.c file with one function\n* easy to use, just returns a given key-value pair location in the JSON string\n* no dependencies, embedded friendly\n* requires no memory/malloc or copying, uses only what is passed in (up to `int` max length)\n* more flexible than strict JSON and allows bare keys (non-validating)\n* optimized for high speed scanning/routing of small chunks of json, stops parsing upon match\n* safely errors on anything really bad (binary, NULLs, etc)\n\nParsing this:\n\n````json\n{\n    \"barbar\": [\n        1,\n        2,\n        3\n    ],\n    \"foo\": \"bar\",\n    \"obj\": {\n        \"a\": \"b\"\n    }\n}\n\n````\n\nUsing `val = js0n(\"barbar\", 6, json, strlen(json), \u0026vlen)` would return a val pointing to `[1,2,3]` and set vlen to `7`.\n\nFor arrays, pass `NULL` as the key, and the array offset as the second argument.\n\nWhen the value is not found `NULL` is returned, if there were any parsing errors then vlen will be set to `-1`.\n\nTo determine if the returned value is an actual JSON string or a bare value (like `\"true\"` vs `true`), simply check if it starts with a quote character via `if(val \u0026\u0026 *(val-1) == '\"')`.\n\nFor more usage examples see the [test.json](test/test.json) and [test.c](test/test.c).\n\n## History\n\nSee [v1.0](https://github.com/quartzjer/js0n/tree/v1.0) for the original `js0n` function that returned an index of offsets for all key/values in one pass.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquartzjer%2Fjs0n","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquartzjer%2Fjs0n","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquartzjer%2Fjs0n/lists"}