{"_id":"@bun-win32/hid","_rev":"6-816fdee5748b03014ef314fb40aa5719","name":"@bun-win32/hid","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/hid","version":"1.0.0","keywords":["bun","ffi","win32","windows","hid","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/hid@1.0.0","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"b28c3de30b9143365600f642009fd1308add57e7","tarball":"https://registry.npmjs.org/@bun-win32/hid/-/hid-1.0.0.tgz","fileCount":6,"integrity":"sha512-1Sv4GgzqM1gS6trq+Rh5v1CC+HChV3nIwdzrIVO0YS9r2+5GOAWq8D06ageiP5OPE7pO2nnOmT1F76JIxaslBg==","signatures":[{"sig":"MEYCIQDIprvKV1iKhSxL7fz/VLetI3VLzB7D4AounibJf/Z+LwIhAJG8BtjKp4aZB8zbXGQYeZjhKUTOyWFrfolIxgTh6YY1","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31657},"main":"./index.ts","type":"module","module":"index.ts","shasum":"b28c3de30b9143365600f642009fd1308add57e7","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example":"bun ./example/hid.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-1Sv4GgzqM1gS6trq+Rh5v1CC+HChV3nIwdzrIVO0YS9r2+5GOAWq8D06ageiP5OPE7pO2nnOmT1F76JIxaslBg==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/hid"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 HID bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.1"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/hid_1.0.0_1775580089561_0.3230571262019275","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bun-win32/hid","version":"1.0.1","keywords":["bun","ffi","win32","windows","hid","bindings","typescript","dll"],"author":{"name":"Stev Peifer","email":"stev@bell.net"},"license":"MIT","_id":"@bun-win32/hid@1.0.1","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"20bced011ea36f333ecd146e5f2f6e1eaeb50c63","tarball":"https://registry.npmjs.org/@bun-win32/hid/-/hid-1.0.1.tgz","fileCount":6,"integrity":"sha512-8zEvsBkbwbOvqToZwXJtz2Du40hUxwubCH404G+YLvVPaqfZwTOrLbZiE3dsS2LLihBXjG3L7DU1H7OGL7MSpQ==","signatures":[{"sig":"MEUCIDpLP1B5PTqWLWKhb+ipx9ab2L7LpaKnnKNr07B5OiiNAiEArBzlvuUAkdm6zWov/5wgLoZkNKlVUboir9rQ7O22PRo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32036},"main":"./index.ts","type":"module","module":"index.ts","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"gitHead":"f86f0df557aa6cfee8907bf3af5592855a854c15","private":false,"scripts":{"example":"bun ./example/hid.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/hid"},"_npmVersion":"10.1.0","description":"Zero-dependency, zero-overhead Win32 HID bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"20.8.0","dependencies":{"@bun-win32/core":"workspace:*"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/hid_1.0.1_1775584492547_0.5701178891434988","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@bun-win32/hid","version":"1.0.2","keywords":["bun","ffi","win32","windows","hid","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/hid@1.0.2","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"184ff270a570cadec1aae963254ca97f976f0edb","tarball":"https://registry.npmjs.org/@bun-win32/hid/-/hid-1.0.2.tgz","fileCount":6,"integrity":"sha512-o9+W8cZQY3fSQtCngxPfdH7nypeRSs+m4j/M1HeYzZ3Lq8Ly+oZc15Waa8BpxgraTtR/eEdqIM2oTf8gmh8OWA==","signatures":[{"sig":"MEUCIQC/ZP81AuyzUzM+KZKkkLwBcELPHr43mfLRE8hmvwQPtQIgWH8EdcdlemL3oTLQSk6jY2pMqD4ssUvlqzxXjgxlaIc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32068},"main":"./index.ts","type":"module","module":"index.ts","shasum":"184ff270a570cadec1aae963254ca97f976f0edb","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example":"bun ./example/hid.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-o9+W8cZQY3fSQtCngxPfdH7nypeRSs+m4j/M1HeYzZ3Lq8Ly+oZc15Waa8BpxgraTtR/eEdqIM2oTf8gmh8OWA==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/hid"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 HID bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.1"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/hid_1.0.2_1775616183814_0.4540807975076473","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@bun-win32/hid","version":"1.0.3","keywords":["bun","ffi","win32","windows","hid","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/hid@1.0.3","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"ad660148bd8e97e10a0bf917b40e64780cd53b5a","tarball":"https://registry.npmjs.org/@bun-win32/hid/-/hid-1.0.3.tgz","fileCount":6,"integrity":"sha512-J99jlLEY2+DXShJPUFQ1RW/mShijVNdfx5CyjfB/cTrdRRKISJdgbbruluu8k8RW2Nnz2/tV9Cqph8BvQlA5ZA==","signatures":[{"sig":"MEYCIQC/ekI1kifq6Egct2EoIPNVTowCPUTaMXSJPxuCzwaf/QIhAOoCa6/UgbjMhtnxb+XkzdfSm/7NpDuGWTn/wJD3VA/7","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32190},"main":"./index.ts","type":"module","module":"index.ts","shasum":"ad660148bd8e97e10a0bf917b40e64780cd53b5a","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:hid-audit":"bun ./example/hid-audit.ts","example:device-detective":"bun ./example/device-detective.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-J99jlLEY2+DXShJPUFQ1RW/mShijVNdfx5CyjfB/cTrdRRKISJdgbbruluu8k8RW2Nnz2/tV9Cqph8BvQlA5ZA==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/hid"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 HID bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.1"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","@bun-win32/kernel32":"1.0.20"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/hid_1.0.3_1775687644505_0.8364612522630233","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/hid","version":"2.0.0","keywords":["bun","ffi","win32","windows","hid","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/hid@2.0.0","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"3b91aa3fb669918ade371e1c987fcec87729066d","tarball":"https://registry.npmjs.org/@bun-win32/hid/-/hid-2.0.0.tgz","fileCount":6,"integrity":"sha512-p6yH/ON8exQwa/IGZ7WN1jE4E1Td7+NDGbBeEghmhe1ORFpT1eyYUsdW7lsiSq9YI/nFtE0SrJBwh2DTJ+BJfg==","signatures":[{"sig":"MEUCIA4+xa46uYZMbOLTgBRmShuH+XbyYxJeZ3vuCrGQEs+hAiEAxM0uHI1cS6VaFhWymXBqGPTWOJBGPzoCZIrjTu2LqfM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34238},"main":"./index.ts","type":"module","module":"index.ts","shasum":"3b91aa3fb669918ade371e1c987fcec87729066d","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:hid-audit":"bun ./example/hid-audit.ts","example:dualsense-radar":"bun ./example/dualsense-radar.ts","example:device-detective":"bun ./example/device-detective.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-p6yH/ON8exQwa/IGZ7WN1jE4E1Td7+NDGbBeEghmhe1ORFpT1eyYUsdW7lsiSq9YI/nFtE0SrJBwh2DTJ+BJfg==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/hid"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 HID bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"26.3.0","dependencies":{"@bun-win32/core":"2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","@bun-win32/kernel32":"2.0.0"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/hid_2.0.0_1782435319956_0.2975249479072164","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"author":"Stev Peifer <stev.p@outlook.com>","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dependencies":{"@bun-win32/core":"2.0.1"},"description":"Zero-dependency, zero-overhead Win32 HID bindings for Bun (FFI) on Windows.","devDependencies":{"@bun-win32/kernel32":"2.0.1","@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/hid","peerDependencies":{"typescript":"^5"},"private":false,"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/hid"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","hid","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:device-detective":"bun ./example/device-detective.ts","example:dualsense-radar":"bun ./example/dualsense-radar.ts","example:hid-audit":"bun ./example/hid-audit.ts"},"_id":"@bun-win32/hid@2.0.1","_integrity":"sha512-4mt3yn7JFbzDY8nJCvSsmJfV9CDgQoyI9wBLNHSNhcG4erTe8fxEBgO5SN0NqRfhHSjvfGmKx1Q36Wgd8RlBGA==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"fa9cc66cba8c9e51df4a278af4e109fd9e065d61","dist":{"integrity":"sha512-4mt3yn7JFbzDY8nJCvSsmJfV9CDgQoyI9wBLNHSNhcG4erTe8fxEBgO5SN0NqRfhHSjvfGmKx1Q36Wgd8RlBGA==","shasum":"fa9cc66cba8c9e51df4a278af4e109fd9e065d61","tarball":"https://registry.npmjs.org/@bun-win32/hid/-/hid-2.0.1.tgz","fileCount":6,"unpackedSize":34238,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFrc6ss3c2Ic2B8SrcNFsANZvFKBXC8XxNbpAvfEQmYXAiB1QCq4iSE0AP4qo0nidCfwtkJBgk0/awpFrtrXWHDlmA=="}]},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"directories":{},"maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/hid_2.0.1_1782437783640_0.4051542480288939"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-07T16:41:29.424Z","modified":"2026-06-26T01:36:23.912Z","1.0.0":"2026-04-07T16:41:29.721Z","1.0.1":"2026-04-07T17:54:52.691Z","1.0.2":"2026-04-08T02:43:03.942Z","1.0.3":"2026-04-08T22:34:04.657Z","2.0.0":"2026-06-26T00:55:20.090Z","2.0.1":"2026-06-26T01:36:23.787Z"},"bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","homepage":"https://github.com/ObscuritySRL/bun-win32#readme","keywords":["bun","ffi","win32","windows","hid","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/hid"},"description":"Zero-dependency, zero-overhead Win32 HID bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/hid\n\nZero-dependency, zero-overhead Win32 HID bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/hid` exposes the `hid.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Hid`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.\n\nThe bindings are strongly typed for a smooth DX in TypeScript.\n\n## Features\n\n- [Bun](https://bun.sh)-first ergonomics on Windows 10/11.\n- Direct FFI to `hid.dll` (HID device access, feature reports, preparsed data parsing, and more).\n- In-source docs in `structs/Hid.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Hid.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/Hid.ts`).\n\n## Requirements\n\n- [Bun](https://bun.sh) runtime\n- Windows 10 or later\n\n## Installation\n\n```sh\nbun add @bun-win32/hid\n```\n\n## Quick Start\n\n```ts\nimport Hid from '@bun-win32/hid';\n\n// Optionally bind a subset up-front\nHid.Preload(['HidD_GetHidGuid', 'HidP_GetCaps']);\n\n// Get the HID device interface GUID\nconst guidBuf = Buffer.alloc(16);\nHid.HidD_GetHidGuid(guidBuf.ptr);\n\n// Read GUID fields\nconst data1 = guidBuf.readUInt32LE(0);\nconst data2 = guidBuf.readUInt16LE(4);\nconst data3 = guidBuf.readUInt16LE(6);\nconst data4 = [...guidBuf.subarray(8, 16)].map((b) => b.toString(16).padStart(2, '0')).join('');\nconsole.log('HID GUID: %08X-%04X-%04X-%s', data1, data2, data3, data4);\n```\n\n> [!NOTE]\n> AI agents: see `AI.md` for the package binding contract and source-navigation guidance. It explains how to use the package without scanning the entire implementation.\n\n## Examples\n\nRun the included examples:\n\n```sh\nbun run example              # HID GUID retrieval\n```\n\n## Notes\n\n- Either rely on lazy binding or call `Hid.Preload()`.\n- Windows only. Bun runtime required.\n- **SAL types & naming:** nullability is in the **type** — `Optional<T>` (formally optional, SAL `_*opt_`) and `Nullable<T>` (plain `[in]`/`[out]` the docs say can be NULL), the null sentinel derived from `T` (`null` for pointers `LP*`/`P*`, `0n` for handles/by-value addresses); direction is in the **parameter name** — `_out` (`_Out_`), `_in_out` (`_Inout_`), `_In_` bare. See `AI.md` and the repo `AGENTS.md`.\n","readmeFilename":"README.md"}