Socket
Socket
Sign inDemoInstall

node-hid

Package Overview
Dependencies
38
Maintainers
5
Versions
43
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.1 to 2.1.2

LICENSE-bsd.txt

6

package.json
{
"name": "node-hid",
"description": "USB HID device access library",
"version": "2.1.1",
"version": "2.1.2",
"author": "Hans Hübner <hans.huebner@gmail.com> (https://github.com/hanshuebner)",

@@ -48,6 +48,6 @@ "bugs": "https://github.com/node-hid/node-hid/issues",

"node-addon-api": "^3.0.2",
"prebuild-install": "^6.0.0"
"prebuild-install": "^7.1.1"
},
"devDependencies": {
"prebuild": "^10.0.1",
"prebuild": "^11.0.4",
"rimraf": "^2.6.2"

@@ -54,0 +54,0 @@ },

@@ -25,2 +25,14 @@ How to publish node-hid

#### MacOS Arm vs x64 notes
- By default we build on arm64. To get Intel x64 builds, one way:
```
arch -x86_64 zsh # create subshell with new arch
nvm install v16 # reinstall v16
node -p process.arch # verify what arch we're on
npm install
npm run showdevices
npm run prebuild
... and so on
exit # get back to original shell
```

@@ -27,0 +39,0 @@ #### Misc Notes (may be obviated in move to N-API)####

@@ -8,2 +8,3 @@ # node-hid - Access USB HID devices from Node.js #

* [node-hid - Access USB HID devices from Node.js](#node-hid---access-usb-hid-devices-from-nodejs)

@@ -43,3 +44,3 @@ * [Platform Support](#platform-support)

* [Thread safety, Worker threads, Context-aware modules](#thread-safety-worker-threads-context-aware-modules)
* [Keyboards and Mice](#keyboards-and-mice)
* [Devices node-hid cannot read](#devices-node-hid-cannot-read)
* [Mac notes](#mac-notes)

@@ -49,4 +50,4 @@ * [Windows notes](#windows-notes)

* [Linux notes](#linux-notes)
* [udev device permissions](#udev-device-permissions)
* [Selecting driver type](#selecting-driver-type)
* [udev device permissions](#udev-device-permissions)
* [Compiling from source](#compiling-from-source)

@@ -64,3 +65,2 @@ * [Linux (kernel 2.6 ) : (install examples shown for Debian/Ubuntu)](#linux-kernel-26--install-examples-shown-for-debianubuntu)

## Platform Support

@@ -90,3 +90,3 @@ `node-hid` supports Node.js v6 and upwards. For versions before that,

* Node v8 to
* Node v14
* Node v16

@@ -96,11 +96,9 @@ ### Supported Electron versions ###

* Electron v3 to
* Electron v11
* Electron v16
#### Any newer version of Electron or Node MAY NOT WORK
Native modules like `node-hid` require upstream dependencies to be updated to work with newer Node and Electron versions. Unless you need the features in the most recent Electron or Node, use a supported version.
Future versions of Node or Electron should work, since `node-hid` is now based on NAPI.
## Installation
For most "standard" use cases (node v4.x on mac, linux, windows on a x86 or x64 processor), `node-hid` will install like a standard npm package:
For most "standard" use cases (macOS, Windows, Linux x86), `node-hid` will install like a standard npm package:

@@ -370,8 +368,19 @@ ```

### Keyboards and Mice
### Devices `node-hid` cannot read
The following devices are unavailable to `node-hid` because the OS owns them:
- Keyboards
- Mice
- Barcode readers (in USB HID keyboard mode)
- RFID scanners (in USB HID keyboard mode)
- Postage Scales (in USB HID keyboard mode)
Most OSes will prevent USB HID keyboards or mice, or devices that appear as a keyboard to the OS.
This includes many RFID scanners, barcode readers, USB HID scales, and many other devices.
This is a security precaution. Otherwise, it would be trivial to build keyloggers.
There are non-standard work-arounds for this, but in general you cannot use `node-hid` to access keyboard-like devices.
Some keyboard-pretending devices like barcode or RFID readers can be configured to be in
"HID data" mode or "Serial / UART" mode. If in "HID Data" mode then `node-hid` can access them,
if in "Serial / UART" mode, you should use `node-serialport` instead.
## Mac notes

@@ -447,7 +456,6 @@ See General notes above Keyboards

### Linux (kernel 2.6+) : (install examples shown for Debian/Ubuntu)
* Compilation tools: `apt install build-essential git`
* gcc-4.8+: `apt install gcc-4.8 g++-4.8 && export CXX=g++-4.8`
* libusb-1.0-0 w/headers:`apt install libusb-1.0-0 libusb-1.0-0-dev`
* Compilation tools: `apt install build-essential git pkg-config`
* libudev-dev: `apt install libudev-dev` (Debian/Ubuntu) /
`yum install libusbx-devel` (Fedora)
* libusb-1.0-0 w/headers:`apt install libusb-1.0-0 libusb-1.0-0-dev`

@@ -461,2 +469,4 @@ ### FreeBSD

### Windows 7, 8, 10
The below is slightly stale. The 2021 solution is to use the official NodeJs Windows installer
and pick "install native module tools"
* Visual C++ compiler and Python 2.7

@@ -546,2 +556,3 @@ * either:

* [electron-hid-test](https://github.com/todbot/electron-hid-test) - Simple example of using `node-hid`, should track latest Electron release
* [electron-hid-test-erb](https://github.com/todbot/electron-hid-test-erb) - Simple example of using `node-hid` using [electron-react-boilerplate](https://github.com/electron-react-boilerplate/electron-react-boilerplate/)
* [electron-hid-toy](https://github.com/todbot/electron-hid-toy) - Simple example of using `node-hid`, showing packaging and signing

@@ -548,0 +559,0 @@ * [Blink1Control2](https://github.com/todbot/Blink1Control2/) - a complete application, using webpack (e.g. see its [webpack-config.js](https://github.com/todbot/Blink1Control2/blob/master/webpack.config.js))

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc