{"id":13741270,"url":"https://github.com/rdpoor/jems","last_synced_at":"2025-05-08T21:33:06.851Z","repository":{"id":69792691,"uuid":"552399856","full_name":"rdpoor/jems","owner":"rdpoor","description":"jems: a stream-based JSON serialized for embedded systems","archived":false,"fork":false,"pushed_at":"2023-04-15T21:22:00.000Z","size":24,"stargazers_count":9,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-04T04:07:36.678Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rdpoor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2022-10-16T14:06:09.000Z","updated_at":"2024-06-04T08:49:27.000Z","dependencies_parsed_at":"2024-01-14T23:57:02.436Z","dependency_job_id":"551ef323-a0ed-432e-b268-1c681c30882b","html_url":"https://github.com/rdpoor/jems","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdpoor%2Fjems","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdpoor%2Fjems/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdpoor%2Fjems/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdpoor%2Fjems/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rdpoor","download_url":"https://codeload.github.com/rdpoor/jems/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224774730,"owners_count":17367784,"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-03T04:00:57.369Z","updated_at":"2024-11-15T11:31:04.470Z","avatar_url":"https://github.com/rdpoor.png","language":"C","funding_links":[],"categories":["C Libraries"],"sub_categories":["JSON"],"readme":"# jems\njems: a stream-based JSON serialized for embedded systems\n\n## About `jems`\n\n`jems` is a compact, stream-based JSON serializer written in pure C for embedded\nsystems.\n\n`jems` makes it easy generate complex JSON structures, writing the results into\na buffer, string or stream.  Specifically designed for embedded systems, `jems`\nis:\n* **compact**: one source file and one header file\n* **portable**: written in pure C (with C++ compatible headers)\n* **deterministic**: `jems` uses user-provided data structures and never calls\n`malloc()`.\n* **yours to use**: `jems` is covered under the permissive MIT License.\n\n`jems` derives much of its efficiency and small footprint by a philosophy of\ntrust: Rather than provide rigorous error checking of input parameters,\n`jems` instead assumes that you provide valid parameters to function calls.\n\n## A Short Example\n\n`jems` has a \"emit characters as you go\" philosophy, which allows you to\ngenerate huge JSON structures with minimal memory usage.  Here is a short\nexample:\n\n```\n#include \"jems.h\"\n#include \u003cstdint.h\u003e\n#include \u003cstdio.h\u003e\n\n#define MAX_LEVEL 10  // how deeply nested the JSON structures can get\nstatic jems_level_t jems_levels[MAX_LEVEL];\nstatic jems_t jems;\n\nstatic void write_char(char ch, uintptr_t arg) {\n  fputc(ch, (FILE *)arg);\n}\n\nint main(void) {\n    // initalize the jems object, using fputc() as the method for writing chars.\n    jems_init(\u0026jems, jems_levels, MAX_LEVEL, write_char, (uintptr_t)stdout);\n\n    jems_object_open(\u0026jems);       // start an object.\n    jems_string(\u0026jems, \"colors\");  // first object key is \"colors\"\n    jems_array_open(\u0026jems);        // first object value is an array\n    jems_integer(\u0026jems, 1);        // ... with three numbers\n    jems_integer(\u0026jems, 2);\n    jems_integer(\u0026jems, 3);\n    jems_array_close(\u0026jems);      // end of the array\n    jems_string(\u0026jems, \"valid\");  // second object key is \"valid\"\n    jems_true(\u0026jems);             // second object value is true\n    jems_object_close(\u0026jems);     // end of the object\n}\n```\nThis program will print\n```\n    {\"colors\":[1,2,3],\"valid\":true}\n```\non the standard output.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdpoor%2Fjems","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frdpoor%2Fjems","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdpoor%2Fjems/lists"}