{"id":21660276,"url":"https://github.com/mitchellh/zig-libuv","last_synced_at":"2025-07-17T23:31:10.997Z","repository":{"id":66228486,"uuid":"598248679","full_name":"mitchellh/zig-libuv","owner":"mitchellh","description":"Zig bindings for libuv. Also a build script to build libuv from scratch using only Zig (for easy cross-compilation, integration with Zig, etc.).","archived":true,"fork":false,"pushed_at":"2023-02-06T18:08:59.000Z","size":172,"stargazers_count":19,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-14T03:39:20.599Z","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/mitchellh.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-02-06T18:02:18.000Z","updated_at":"2025-07-02T21:56:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"f08d8ecf-68fa-4cf6-a426-f849f79ccf66","html_url":"https://github.com/mitchellh/zig-libuv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mitchellh/zig-libuv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fzig-libuv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fzig-libuv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fzig-libuv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fzig-libuv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitchellh","download_url":"https://codeload.github.com/mitchellh/zig-libuv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fzig-libuv/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265678481,"owners_count":23810114,"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-11-25T09:32:37.678Z","updated_at":"2025-07-17T23:31:10.989Z","avatar_url":"https://github.com/mitchellh.png","language":"Zig","funding_links":[],"categories":["Zig"],"sub_categories":[],"readme":"\u003chr\u003e\n\n**⚠️ Project Archived ⚠️.** This project is archived. I used this for a few\nreal projects since 2021 and it was stable, but I've since moved onto using\n[libxev](https://github.com/mitchellh/libxev) so I'm no longer maintaining\nthe libuv bindings.\n\n\u003chr\u003e\n\n# zig-libuv\n\nzig-libuv contains a `build.zig` that can build libuv using Zig and also\ncontains a package with Zig bindings. Both can be used together or separately.\nBuilding libuv with Zig enables easy cross-compilation. The bindings allow\nyou to consume libuv easily whether it is built with Zig or not.\n\n## Example \n\nThere are lots of examples in the tests for each individual handle type.\nBelow is an example of using a timer, copied exactly from the tests:\n\n```zig\nvar loop = try Loop.init(testing.allocator);\ndefer loop.deinit(testing.allocator);\n\nvar timer = try init(testing.allocator, loop);\ndefer timer.deinit(testing.allocator);\n\nvar called: bool = false;\ntimer.setData(\u0026called);\ntry timer.start((struct {\n    fn callback(t: *Timer) void {\n        t.getData(bool).?.* = true;\n        t.close(null);\n    }\n}).callback, 10, 1000);\n\n_ = try loop.run(.default);\n\ntry testing.expect(called);\n```\n\n## Usage\n\nTo **build libuv:**\n\n```zig\nconst libuv = @import(\"path/to/zig-libuv/build.zig\");\n\npub fn build(b: *std.build.Builder) !void {\n    // ...\n\n    const exe = b.addExecutable(\"my-program\", \"src/main.zig\");\n    _ = libuv.link(b, exe);\n}\n```\n\nTo **use the Zig bindings**, add the package:\n\n```zig\nexe.addPackage(libuv.pkg);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitchellh%2Fzig-libuv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitchellh%2Fzig-libuv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitchellh%2Fzig-libuv/lists"}