{"id":18658855,"url":"https://github.com/durobot/zigstructprint","last_synced_at":"2025-11-06T00:30:26.373Z","repository":{"id":225311603,"uuid":"765627725","full_name":"Durobot/zigStructPrint","owner":"Durobot","description":"Small library to pretty-print Zig structs (and arrays)","archived":false,"fork":false,"pushed_at":"2024-10-10T07:01:15.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T06:53:57.072Z","etag":null,"topics":["zig","zig-package","ziglang"],"latest_commit_sha":null,"homepage":"","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/Durobot.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":"2024-03-01T09:52:26.000Z","updated_at":"2024-10-10T07:01:19.000Z","dependencies_parsed_at":"2024-11-07T07:37:08.137Z","dependency_job_id":"86a6518b-9fc2-4a37-81ab-3b0ad9153a54","html_url":"https://github.com/Durobot/zigStructPrint","commit_stats":null,"previous_names":["durobot/zigstructprint"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Durobot%2FzigStructPrint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Durobot%2FzigStructPrint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Durobot%2FzigStructPrint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Durobot%2FzigStructPrint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Durobot","download_url":"https://codeload.github.com/Durobot/zigStructPrint/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239475962,"owners_count":19645041,"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":["zig","zig-package","ziglang"],"created_at":"2024-11-07T07:34:40.205Z","updated_at":"2025-11-06T00:30:26.322Z","avatar_url":"https://github.com/Durobot.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"zigStructPrint\n\nSmall library to pretty-print Zig structs (and arrays)\n\n**zigStructPrint** is licensed under under [the MIT License](https://en.wikipedia.org/w/index.php?title=MIT_License\u0026useskin=vector) and available from https://github.com/Durobot/zigStructPrint\n\nPlease note that only Zig **0.14.0-dev.1421+f87dd43c1** (give or take) and up is supported because of [this breaking change](https://github.com/ziglang/zig/commit/0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9) in the Zig standard library. If you need zigStructPrint for an earlier version of Zig, get [this version](https://github.com/Durobot/zigStructPrint/releases/tag/v0.1-beta) instead.\n\nTo use, either drop [zsp.zig](https://github.com/Durobot/zigStructPrint/blob/main/src/zsp.zig) into your project, or, if you prefer Zig package manager:\n\n1. In `build.zig.zon`, in `.dependencies`, add\n\n   ```zig\n   .zigStructPrint =\n   .{\n       .url = \"https://github.com/Durobot/zigStructPrint/archive/\u003cCOMMIT HASH, 40 HEX DIGITS\u003e.tar.gz\",\n       .hash = \"\u003cZIG PACKAGE HASH, 68 HEX DIGITS\u003e\" // Use arbitrary hash, get correct hash from the error \n   }\n   ```\n\n2. In `build.zig`, in `pub fn build`, before `b.installArtifact(exe);`, add\n\n   ```zig\n   const zsp = b.dependency(\"zigStructPrint\",\n   .{\n       .target = target,\n       .optimize = optimize,\n   });\n   exe.root_module.addImport(\"zigStructPrint\", zsp.module(\"zigStructPrint\"));\n   ```\n\nBuild with `zig build`, as you normally do.\n\nActually printing out your struct:\n\n```zig\nconst zsp = @import(\"zigStructPrint\");\n. . .\nconst MyStruct = struct\n{\n    a: i8 = -10,\n    b: u32 = 10,\n    c: [3]u8 = [_]u8 { 1, 2, 3 },\n    d: [2]Nested = .{ .{ .f = 10.0, .g = \"Hello\" }, .{ .f = -20.0, .g = \"Bye\" }, },\n    e: [3]Color = .{ .red, .green, .yellow },\n\n    const Nested = struct { f: f32, g: []const u8 };\n    const Color = enum { red, yellow, green };\n};\nconst ms = MyStruct {};\nzsp.printStruct(ms, true, 0); // try `false` to get full type names\n```\n\nAnd the output is:\n\n```zig\n{\n    a: i8 = -10\n    b: u32 = 10\n    c: [3]u8 = [ 1, 2, 3, ]\n    d: [2]Nested = [ { f: f32 = 10, g: []const u8 = \"Hello\", }, { f: f32 = -20, g: []const u8 = \"Bye\", }, ]\n    e: [3]Color = [ red, green, yellow, ]\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdurobot%2Fzigstructprint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdurobot%2Fzigstructprint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdurobot%2Fzigstructprint/lists"}