{"id":13730339,"url":"https://github.com/septag/sjson","last_synced_at":"2025-08-20T10:32:16.822Z","repository":{"id":149955176,"uuid":"149298412","full_name":"septag/sjson","owner":"septag","description":"Fast and portable single-header C file Json encoder/decoder","archived":false,"fork":false,"pushed_at":"2024-06-12T19:11:27.000Z","size":36,"stargazers_count":58,"open_issues_count":1,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-12-05T19:11:58.454Z","etag":null,"topics":["c","json","single-header-lib"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/septag.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-18T14:04:50.000Z","updated_at":"2024-06-12T19:11:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"6e1eb88a-0a7a-4447-bf3d-e7f8a0828826","html_url":"https://github.com/septag/sjson","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/septag%2Fsjson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/septag%2Fsjson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/septag%2Fsjson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/septag%2Fsjson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/septag","download_url":"https://codeload.github.com/septag/sjson/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230415318,"owners_count":18222158,"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","json","single-header-lib"],"created_at":"2024-08-03T02:01:13.531Z","updated_at":"2024-12-19T10:09:42.933Z","avatar_url":"https://github.com/septag.png","language":"C","readme":"## sjson: Fast and portable C single header json Encoder/Decoder\n[@septag](https://twitter.com/septagh)\n\nThis is actually a fork of Joseph's awesome Json encoder/decoder code from his [repo](https://github.com/rustyrussell/ccan/tree/master/ccan/json).    \nIf you want to see the performance and analysis of the original encoder/decoder (which is _ccan/json_) visit [here](https://github.com/miloyip/nativejson-benchmark).  \nThe encoder/decoder code is almost the same. What I did was adding object pools and string pages (sjson_context)\nthat eliminates many micro memory allocations, which should improve encode/decode speed and data access performance. \nI also added malloc/free and libc API overrides, and made the library single header, so it makes it very easy to integrate it into other programs\n\n### Features\n\n- Single header C-file\n- UTF8 support\n- Fast with minimal allocations (Internal Object pool, String pool, ..)\n- Overriable libc functions like malloc/free/memcpy/.. \n- Supports both Json encoding and decoding\n- Encoder supports prettify \n- No dependencies\n- Simple and easy to use C-API\n\n### Usage\n\n```c\n#define SJSON_IMPLEMENT\n#include \"sjson.h\"\t\n```\n\nFor more information, check out the header file itself.\n\n### Links\n- [cj5](https://github.com/septag/cj5): Fast single header Json5 parser based on [jsmn](https://github.com/zserge/jsmn)\n\n[License (BSD 2-clause)](https://github.com/septag/sjson/blob/master/LICENSE)\n--------------------------------------------------------------------------\n\n\u003ca href=\"http://opensource.org/licenses/BSD-2-Clause\" target=\"_blank\"\u003e\n\u003cimg align=\"right\" src=\"http://opensource.org/trademarks/opensource/OSI-Approved-License-100x137.png\"\u003e\n\u003c/a\u003e\n\n\tCopyright 2018 Sepehr Taghdisian. All rights reserved.\n\t\n\thttps://github.com/septag/sjson\n\t\n\tRedistribution and use in source and binary forms, with or without\n\tmodification, are permitted provided that the following conditions are met:\n\t\n\t   1. Redistributions of source code must retain the above copyright notice,\n\t      this list of conditions and the following disclaimer.\n\t\n\t   2. Redistributions in binary form must reproduce the above copyright notice,\n\t      this list of conditions and the following disclaimer in the documentation\n\t      and/or other materials provided with the distribution.\n\t\n\tTHIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER ``AS IS'' AND ANY EXPRESS OR\n\tIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n\tMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n\tEVENT SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n\tINDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n\tBUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n\tDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n\tLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n\tOR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n\tADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseptag%2Fsjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseptag%2Fsjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseptag%2Fsjson/lists"}