{"id":13739871,"url":"https://github.com/Himujjal/zig-json5","last_synced_at":"2025-05-08T19:35:01.168Z","repository":{"id":61930587,"uuid":"556351888","full_name":"Himujjal/zig-json5","owner":"Himujjal","description":"A JSON5 parser/stringifier for Zig resembling the std.json API","archived":false,"fork":false,"pushed_at":"2022-12-21T21:51:47.000Z","size":31,"stargazers_count":23,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-04T04:05:43.285Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Zig","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/Himujjal.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}},"created_at":"2022-10-23T16:55:13.000Z","updated_at":"2024-06-04T02:24:12.000Z","dependencies_parsed_at":"2023-01-30T05:00:24.823Z","dependency_job_id":null,"html_url":"https://github.com/Himujjal/zig-json5","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/Himujjal%2Fzig-json5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Himujjal%2Fzig-json5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Himujjal%2Fzig-json5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Himujjal%2Fzig-json5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Himujjal","download_url":"https://codeload.github.com/Himujjal/zig-json5/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224758226,"owners_count":17364972,"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:38.644Z","updated_at":"2024-11-15T09:30:51.685Z","avatar_url":"https://github.com/Himujjal.png","language":"Zig","funding_links":[],"categories":["Applications"],"sub_categories":[],"readme":"# [zig-json5](https://github.com/Himujjal/zig-json5)\n\nA [JSON5](https://json5.org) parser/stringifier for Zig that resembles the `std.json` API from the standard library\n\n## Installation \n\nSimply get the `src/main.zig` file using [curl](https://curl.se/) or [wget](https://www.gnu.org/software/wget/):\n\nCURL:\n```sh\ncurl https://raw.githubusercontent.com/Himujjal/zig-json5/master/src/main.zig --output json5.zig \n```\n\nWGET:\n```sh\nwget https://raw.githubusercontent.com/Himujjal/zig-json5/master/src/main.zig -O json5.zig\n```\n\n## Docs\n\nThe API is similar to the `std.json` library. Just replace `json` with `json5` wherever possible\n\nFor a short tutorial see: [Zig JSON in 5 minutes](https://www.huy.rocks/everyday/01-09-2022-zig-json-in-5-minutes)\n\nA simple example:\n\n```zig\nfn parseStringifyAndTest(input: []const u8, expected: []const u8) !void {\n    const a = std.testing.allocator;\n\n    var string = std.ArrayList(u8).init(a);\n    defer string.deinit();\n\n    var parser = json5.Parser.init(a, false);\n    defer parser.deinit();\n\n    var tree = try parser.parse(input);\n    defer tree.deinit();\n\n    try tree.root.json5Stringify(.{}, string.writer());\n\n    std.testing.expect(mem.eql(u8, string.items, expected)) catch |err| {\n        std.debug.print(\"\\n == Expected: {s}\\n Got: {s} ==\\n\", .{ expected, string.items });\n        return err;\n    };\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHimujjal%2Fzig-json5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHimujjal%2Fzig-json5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHimujjal%2Fzig-json5/lists"}