{"id":18356668,"url":"https://github.com/aaravmalani/libjson","last_synced_at":"2025-09-14T03:19:41.835Z","repository":{"id":186260236,"uuid":"625020780","full_name":"AaravMalani/libjson","owner":"AaravMalani","description":"A light-weight feature complete JSON parser in C","archived":false,"fork":false,"pushed_at":"2023-10-15T13:10:01.000Z","size":10,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T07:47:58.983Z","etag":null,"topics":["c","cmake","collaborate","complete","fast","github","json","parser","recursive","student-vscode"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AaravMalani.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2023-04-07T21:17:07.000Z","updated_at":"2023-11-20T00:08:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"8639de76-865c-4653-8857-b80ded3a6a64","html_url":"https://github.com/AaravMalani/libjson","commit_stats":null,"previous_names":["aaravmalani/libjson"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AaravMalani%2Flibjson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AaravMalani%2Flibjson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AaravMalani%2Flibjson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AaravMalani%2Flibjson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AaravMalani","download_url":"https://codeload.github.com/AaravMalani/libjson/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248749993,"owners_count":21155681,"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":["c","cmake","collaborate","complete","fast","github","json","parser","recursive","student-vscode"],"created_at":"2024-11-05T22:11:07.851Z","updated_at":"2025-04-13T16:52:03.671Z","avatar_url":"https://github.com/AaravMalani.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libjson: A light-weight feature complete JSON parser\n## Installation\n### Windows\nDownload the zip file from [the latest release](https://github.com/AaravMalani/libjson/releases/latest) and [add it to \nthe Visual Studio link arguments](https://learn.microsoft.com/en-us/cpp/build/adding-references-in-visual-cpp-projects?view=msvc-170)\nOR\nBuild from source \n```bat\ngit clone https://github.com/AaravMalani/libjson/\ncd libjson\ncmake -S . -B build\ncd build\ncmake --build .\ncd ..\nrem The .dll and .lib file is in the build directory\nrem The include files are in the include directory\n```\n### Debian-based Linux\nDownload the [`.deb`](https://github.com/AaravMalani/libjson/releases/latest) file and run\n```bash\nsudo dpkg -i \u003cfile\u003e\n```\nOR\nBuild from source\n\n### Red Hat / CentOS / Fedora \nDownload the [`.rpm`](https://github.com/AaravMalani/libjson/releases/latest) file and \n\n### Linux (From Source)\n```bash\ngit clone https://github.com/AaravMalani/libjson/\ncd libjson\ncmake -S . -B build\ncd build\nsudo make install\ncd ..\n```\n\n## Usage\n```c\n#include \u003cjson.h\u003e\n\nint main(int argc, char** argv){\n    JSONElement* element = parseJSON(\"{\\\"a\\\":\\\"b\\\"}\", NULL); // The second argument is for inner recursed calls and can therefore be NULL\n    printf(\"%s\\n\", (char*) getElement(element, \"a\")-\u003edata); // Get inner element (char* for objects and uint64_t for arrays)\n    freeJSONElement(element);\n    element = parseJSON(\"{\\\"a\\\":[1.0, -1.4]}\", NULL);\n    printf(\"%s\\n\", (char*) getElements(element, 2, \"a\", 0)-\u003edata); // C equivalent of element[\"a\"][0] (first argument is root element, second argument is number of indices and third argument onwards are the indices)\n    freeJSONElement(element);\n    \n    return 0;\n}\n```\nFor all the different types, look at `include/json.h`\nA documentation of the library can be found [here](./docs/docs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaravmalani%2Flibjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faaravmalani%2Flibjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaravmalani%2Flibjson/lists"}