Description
node-hid lets Node.js programs talk to USB and Bluetooth HID devices, such as keyboards, game controllers and other human interface devices. It provides both an asynchronous and a synchronous API, with complete examples for each. Prebuilt native binaries are provided for the most common platforms, including Windows x86 and x64, macOS 10.9 and later, and Linux on x64, ARM and ARM64. On other platforms the package still works, but npm compiles the native binary when you install it. The project supports Node.js versions 10 through 20 and Electron versions 3 through 24, and says that newer versions should work because the module is built on N-API. The README covers platform specific notes for Mac, Windows and Linux, including udev device permissions on Linux and a choice of driver type, hidraw or libusb. It also explains which devices cannot be read and how to build from source for cross compiling, Electron or NW.js projects. A test program, hid-showdevices, is installed when you install the package globally. The library is open source on GitHub.…
Highlights
- Access USB and Bluetooth HID devices from Node.js
- Asynchronous and synchronous APIs
- Prebuilt binaries for Windows, macOS and common Linux platforms
- Works with Node.js 10 to 20 and Electron
- Linux driver choice between hidraw and libusb
Ratings & Reviews
No ratings yet
Be the first to rate Node Hid.
People also visit
Node Hid FAQ
What does node-hid do?
It gives Node.js programs access to USB and Bluetooth HID devices, such as keyboards, controllers and other human interface hardware.
How do I install it?
Run npm install node-hid. Prebuilt binaries cover the common platforms, and other platforms compile the binary during install.
Which Node.js and Electron versions work?
Node.js 10 to 20 and Electron 3 to 24 are listed as supported, and newer versions should work.
Does it work on Linux?
Yes. The README covers udev device permissions and the choice between the hidraw and libusb drivers.
Are there examples?
Yes. The README has complete examples for the async and sync APIs, and a hid-showdevices test program.
Is it free?
Yes. node-hid is open source and its code is on GitHub.
What are the best Node Hid alternatives?
Popular alternatives to Node Hid include Node Serialport, Iohook and PC Nrfconnect Launcher. See all Node Hid alternatives



