{"id":16839039,"url":"https://github.com/fathyb/node-async-ioctl","last_synced_at":"2026-07-14T20:31:22.029Z","repository":{"id":75403545,"uuid":"554708193","full_name":"fathyb/node-async-ioctl","owner":"fathyb","description":"Asynchronous `ioctl` for Node.js","archived":false,"fork":false,"pushed_at":"2022-10-22T07:41:45.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-08T04:07:13.095Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fathyb.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-10-20T08:57:34.000Z","updated_at":"2024-04-03T11:59:15.000Z","dependencies_parsed_at":"2023-06-06T09:45:47.919Z","dependency_job_id":null,"html_url":"https://github.com/fathyb/node-async-ioctl","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/fathyb/node-async-ioctl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fathyb%2Fnode-async-ioctl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fathyb%2Fnode-async-ioctl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fathyb%2Fnode-async-ioctl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fathyb%2Fnode-async-ioctl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fathyb","download_url":"https://codeload.github.com/fathyb/node-async-ioctl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fathyb%2Fnode-async-ioctl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35478682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-14T02:00:06.603Z","response_time":114,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-13T12:28:25.600Z","updated_at":"2026-07-14T20:31:22.024Z","avatar_url":"https://github.com/fathyb.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-async-ioctl\n\nAsynchronous `ioctl` for Node.js. Used for [`node-nbd-client`](https://github.com/fathyb/node-nbd-client), UNIX-only.\n\n## Usage\n\n-   `ioctl(fd: number | bigint, request: number | bigint, value: number | bigint | Buffer): Promise\u003cnumber\u003e`\n    -   meant for `ioctl` calls returning immediately. Uses the libuv thread pool.\n-   `ioctl.batch(batch: [fd: number | bigint, request: number | bigint, value: number | bigint | Buffer][]): Promise\u003cnumber[]\u003e`\n    -   same as `ioctl(fd, request, value)` except requests can be submitted in batches.\n-   `ioctl.blocking(fd: number | bigint, request: number | bigint, value: number | bigint | Buffer): Promise\u003cnumber\u003e`\n    -   meant for `ioctl` calls blocking until something happens. Uses a dedicated thread so more memory and higher latency.\n\n```js\nimport { open } from 'fs'\nimport { ioctl } from 'async-ioctl'\n\n// Get number of rows for current terminal\nconst rows = await ioctl(process.stdout.fd, 0x2000ab00)\n\nasync function getBlockDeviceSize(path: string) {\n    const device = await open(path)\n    const buffer = Buffer.alloc(8)\n\n    await ioctl(device.fd, 0x2000ab00, buffer)\n\n    return buffer\n}\n\n// Buffer argument\nconst result = await ioctl(device.fd, 0x2000ab00, Buffer.from('test'))\n// Buffer argument\nconst result = await ioctl(device.fd, 0x2000ab00, BigInt('13343554'))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffathyb%2Fnode-async-ioctl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffathyb%2Fnode-async-ioctl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffathyb%2Fnode-async-ioctl/lists"}