{"id":15598028,"url":"https://github.com/ibob/jout","last_synced_at":"2026-01-31T22:30:50.119Z","repository":{"id":196811868,"uuid":"697147000","full_name":"iboB/jout","owner":"iboB","description":"A fast minimalistic single-header JSON writer for C++","archived":false,"fork":false,"pushed_at":"2024-05-14T09:04:12.000Z","size":22,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-17T01:43:22.975Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/iboB.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":"2023-09-27T06:40:55.000Z","updated_at":"2023-09-28T01:54:50.000Z","dependencies_parsed_at":"2024-12-19T16:11:37.445Z","dependency_job_id":null,"html_url":"https://github.com/iboB/jout","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"b0bfc6038bdb49eb7bdfef4ef5f7fcc50c6cc4b4"},"previous_names":["ibob/jout"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/iboB/jout","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iboB%2Fjout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iboB%2Fjout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iboB%2Fjout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iboB%2Fjout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iboB","download_url":"https://codeload.github.com/iboB/jout/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iboB%2Fjout/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28958341,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T22:20:19.638Z","status":"ssl_error","status_checked_at":"2026-01-31T22:18:07.061Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-10-03T01:26:29.515Z","updated_at":"2026-01-31T22:30:50.101Z","avatar_url":"https://github.com/iboB.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jout\n\n[![Language](https://img.shields.io/badge/language-C++-blue.svg)](https://isocpp.org/) [![Standard](https://img.shields.io/badge/C%2B%2B-17-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\nA fast minimalistic single-header json writer for C++17.\n\nIt's essentially a trimmed-down version of [huse](https://github.com/iboB/huse) where only the basic JSON serialization is kept. It might be useful if one only wants to write a simple json without having to rely on all deps and features of huse.\n\n## Usage\n\nJust include `jout.hpp` in your project and you're good to go.\n\nOptionally make use of the provided `CMakeLists.txt` which will add the dependency [mscharconv](https://github.com/iboB/mscharconv] in case the one provided by the standard library doesn't supprt `to_chars` for floating point numbers (which is the case for gcc 10, clang 14 and their previous versions).\n\n## Features\n\n* Single header\n* No allocations\n* No dependencies besides the standard library (well, unless you use an old one in which case you'll need mscharconv)\n* Sequential. Values are added as they are encountered in the code. There is no way to go back and modify a value. \n* Optional extension headers to serialize common types\n\n## Example\n\n```cpp\n    // create a document with an ostream and an optional pretty print flag\n    jout::Document doc(std::cout, true);\n\n    // create a root object\n    auto root = doc.obj();\n\n    // add some values\n    root.val(\"hello\", \"world\");\n    root.val(\"number\", 3.14);\n\n    // add an array\n    {\n        // block, array is closed when ar goes out of scope\n        auto ar = root.ar(\"array\");\n        ar.val(1);\n        ar.val(\"str\");\n        ar.val(true);\n        ar.val(nullptr);\n    }\n\n    // add a subobject\n    {\n        // block, object is closed when obj goes out of scope\n        auto obj = root.obj(\"object\");\n        obj.val(\"key\", \"value\");\n    }\n```\n\n### Writing Custom Types\n\nCreate an overload of `joutWrite` as per the example below:\n\n```c++\n    struct Person {\n        std::string name;\n        int age;\n        std::vector\u003cstd::string\u003e pets;\n    };\n\n    // create an overload of joutWrite for your type\n    // be sure that it's either in namespace jout \n    // or in the namespace of your type\n    void joutWrite(jout::Node\u0026 node, const Person\u0026 p) {\n        auto obj = node.obj();\n        obj.val(\"name\", p.name);\n        obj.val(\"age\", p.age);\n        obj.val(\"pets\", p.pets);\n    }\n```\n\nThen you can write instances of your type with `val`, like any other value:\n\n```c++\n    Person alice = {\n        \"Alice B.\",\n        35,\n        {\"Lucky\", \"Fido\", \"Goldie\"}\n    };\n    doc.val(alice);\n```\n\n## License\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\nThis software is distributed under the MIT Software License.\n\nSee accompanying file LICENSE or copy [here](https://opensource.org/licenses/MIT).\n\nCopyright \u0026copy; 2023 [Borislav Stanimirov](http://github.com/iboB)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibob%2Fjout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibob%2Fjout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibob%2Fjout/lists"}