{"id":35015251,"url":"https://github.com/metacall/nodejs-c-io_uring-example","last_synced_at":"2026-04-26T17:31:20.183Z","repository":{"id":104919552,"uuid":"428646385","full_name":"metacall/nodejs-c-io_uring-example","owner":"metacall","description":"Using io_uring Linux Kernel interface from NodeJS by JITing C code with MetaCall.","archived":false,"fork":false,"pushed_at":"2025-01-13T17:12:02.000Z","size":90,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-28T19:03:28.701Z","etag":null,"topics":["c","interoperability","io-uring","jit","liburing","nodejs"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/metacall.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":"2021-11-16T12:29:00.000Z","updated_at":"2025-01-13T17:12:06.000Z","dependencies_parsed_at":"2025-01-09T01:27:08.295Z","dependency_job_id":"5f7601fa-6fca-4e86-9706-542ac40ecd47","html_url":"https://github.com/metacall/nodejs-c-io_uring-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/metacall/nodejs-c-io_uring-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metacall%2Fnodejs-c-io_uring-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metacall%2Fnodejs-c-io_uring-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metacall%2Fnodejs-c-io_uring-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metacall%2Fnodejs-c-io_uring-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metacall","download_url":"https://codeload.github.com/metacall/nodejs-c-io_uring-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metacall%2Fnodejs-c-io_uring-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32307010,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T17:23:19.671Z","status":"ssl_error","status_checked_at":"2026-04-26T17:23:19.195Z","response_time":129,"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":["c","interoperability","io-uring","jit","liburing","nodejs"],"created_at":"2025-12-27T05:18:33.576Z","updated_at":"2026-04-26T17:31:20.153Z","avatar_url":"https://github.com/metacall.png","language":"C","readme":"# [MetaCall](https://github.com/metacall/core) NodeJS C `io_uring` Example\n\n[`io_uring`](https://en.wikipedia.org/wiki/Io_uring) is a new Linux Kernel interface that speeds up I/O operations in comparison to previous implementations like [`libuv`](https://libuv.org/) (the library that NodeJS uses internally for handling I/O).\n\nThis interface is offered through [`liburing`](https://github.com/axboe/liburing), which provides a C API for accessing it. We could write a NodeJS extension by using [`N-API`](https://nodejs.org/api/n-api.html), or use [`ffi`](https://www.npmjs.com/package/ffi) in order to call to the library.\n\nDeveloping those wrappers is costly because either we have to write C/C++ or JavaScript boilerplate. So instead of doing that, we will be using [MetaCall](https://github.com/metacall/core) in order to achieve this.\n\nMetaCall allows to transparently call to C functions, we can implement anything in C and without need to compile it manually (it will be JITed at load time). So basically we can load C code directly into NodeJS. For example:\n\n```c\nint sum(int a, int b) {\n\treturn a + b;\n}\n```\n\n```js\nconst { sum } = require(\"./sum.c\");\n\nsum(3, 4) // 7\n```\n\nWith this we can use our C library not only from NodeJS but from any other language, for example, Python:\n\n```py\nfrom sum.c import sum\n\nsum(3, 4) # 7\n```\n\nWe will be avoiding all the boilerplate and we will have a single interface for all languages. The calls will be also type safe and we will avoid a lot of errors and time for maintaining the wrappers for each language that we can spend focusing on the development.\n\nIn this example we want to bring the power of `io_uring` to NodeJS for maximizing the speed of I/O and outperform NodeJS native primitives like `http` module. For demonstrating it, we have a `server_listen` function which creates a simple HTTP server in the port `8000`.\n\n## Docker\n\nBuilding and running with Docker:\n\n```bash\ndocker build -t metacall/nodejs-c-liburing-example .\ndocker run --rm -p 8000:8000 -it metacall/nodejs-c-liburing-example\n```\n\n## Accessing to the website\n\nJust go to your web browser and enter this url: `localhost:8000`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetacall%2Fnodejs-c-io_uring-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetacall%2Fnodejs-c-io_uring-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetacall%2Fnodejs-c-io_uring-example/lists"}