Socket
Socket
Sign inDemoInstall

node-hid

Package Overview
Dependencies
Maintainers
5
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-hid - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

7

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

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

"nan": "^2.14.0",
"prebuild-install": "^5.3.3"
"node-abi": "^2.18.0",
"prebuild-install": "^5.3.4"
},
"devDependencies": {
"prebuild": "^9.1.1",
"prebuild": "^10.0.0",
"rimraf": "^2.6.2"

@@ -48,0 +49,0 @@ },

@@ -7,54 +7,54 @@ # 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)
* [Platform Support](#platform-support)
* [Supported Platforms](#supported-platforms)
* [Supported Node versions](#supported-node-versions)
* [Supported Electron versions](#supported-electron-versions)
* [Installation](#installation)
* [Installation Special Cases](#installation-special-cases)
* [Examples](#examples)
* [Usage](#usage)
* [List all HID devices connected](#list-all-hid-devices-connected)
* [Cost of HID.devices() and <code>new HID.HID()</code> for detecting device plug/unplug](#cost-of-hiddevices-and-new-hidhid-for-detecting-device-plugunplug)
* [Opening a device](#opening-a-device)
* [Picking a device from the device list](#picking-a-device-from-the-device-list)
* [Reading from a device](#reading-from-a-device)
* [Writing to a device](#writing-to-a-device)
* [Complete API](#complete-api)
* [devices = HID.devices()](#devices--hiddevices)
* [HID.setDriverType(type)](#hidsetdrivertypetype)
* [device = new HID.HID(path)](#device--new-hidhidpath)
* [device = new HID.HID(vid,pid)](#device--new-hidhidvidpid)
* [device.on('data', function(data) {} )](#deviceondata-functiondata--)
* [device.on('error, function(error) {} )](#deviceonerror-functionerror--)
* [device.write(data)](#devicewritedata)
* [device.close()](#deviceclose)
* [device.pause()](#devicepause)
* [device.resume()](#deviceresume)
* [device.read(callback)](#devicereadcallback)
* [device.readSync()](#devicereadsync)
* [device.readTimeout(time_out)](#devicereadtimeouttime_out)
* [device.sendFeatureReport(data)](#devicesendfeaturereportdata)
* [device.getFeatureReport(report_id, report_length)](#devicegetfeaturereportreport_id-report_length)
* [device.setNonBlocking(no_block)](#devicesetnonblockingno_block)
* [General notes:](#general-notes)
* [Thread safety, Worker threads, Context-aware modules](#thread-safety-worker-threads-context-aware-modules)
* [Keyboards and Mice](#keyboards-and-mice)
* [Mac notes](#mac-notes)
* [Windows notes](#windows-notes)
* [Xbox 360 Controller on Windows 10](#xbox-360-controller-on-windows-10)
* [Linux notes](#linux-notes)
* [Selecting driver type](#selecting-driver-type)
* [udev device permissions](#udev-device-permissions)
* [Compiling from source](#compiling-from-source)
* [Linux (kernel 2.6 ) : (install examples shown for Debian/Ubuntu)](#linux-kernel-26--install-examples-shown-for-debianubuntu)
* [Mac OS X 10.8 ](#mac-os-x-108)
* [Windows 7, 8, 10](#windows-7-8-10)
* [Building node-hid from source, for your projects](#building-node-hid-from-source-for-your-projects)
* [Build node-hid for <code>node-hid</code> development:](#build-node-hid-for-node-hid-development)
* [Electron projects using node-hid](#electron-projects-using-node-hid)
* [NW.js projects using node-hid](#nwjs-projects-using-node-hid)
* [Support](#support)
* [node-hid - Access USB HID devices from Node.js](#node-hid---access-usb-hid-devices-from-nodejs)
* [Platform Support](#platform-support)
* [Supported Platforms](#supported-platforms)
* [Supported Node versions](#supported-node-versions)
* [Supported Electron versions](#supported-electron-versions)
* [Installation](#installation)
* [Installation Special Cases](#installation-special-cases)
* [Examples](#examples)
* [Usage](#usage)
* [List all HID devices connected](#list-all-hid-devices-connected)
* [Cost of HID.devices() and <code>new HID.HID()</code> for detecting device plug/unplug](#cost-of-hiddevices-and-new-hidhid-for-detecting-device-plugunplug)
* [Opening a device](#opening-a-device)
* [Picking a device from the device list](#picking-a-device-from-the-device-list)
* [Reading from a device](#reading-from-a-device)
* [Writing to a device](#writing-to-a-device)
* [Complete API](#complete-api)
* [devices = HID.devices()](#devices--hiddevices)
* [HID.setDriverType(type)](#hidsetdrivertypetype)
* [device = new HID.HID(path)](#device--new-hidhidpath)
* [device = new HID.HID(vid,pid)](#device--new-hidhidvidpid)
* [device.on('data', function(data) {} )](#deviceondata-functiondata--)
* [device.on('error, function(error) {} )](#deviceonerror-functionerror--)
* [device.write(data)](#devicewritedata)
* [device.close()](#deviceclose)
* [device.pause()](#devicepause)
* [device.resume()](#deviceresume)
* [device.read(callback)](#devicereadcallback)
* [device.readSync()](#devicereadsync)
* [device.readTimeout(time_out)](#devicereadtimeouttime_out)
* [device.sendFeatureReport(data)](#devicesendfeaturereportdata)
* [device.getFeatureReport(report_id, report_length)](#devicegetfeaturereportreport_id-report_length)
* [device.setNonBlocking(no_block)](#devicesetnonblockingno_block)
* [Mac notes](#mac-notes)
* [Keyboards and Mice](#keyboards-and-mice)
* [Windows notes](#windows-notes)
* [Keyboards and Mice](#keyboards-and-mice-1)
* [Xbox 360 Controller on Windows 10](#xbox-360-controller-on-windows-10)
* [Linux notes](#linux-notes)
* [Selecting driver type](#selecting-driver-type)
* [udev device permissions](#udev-device-permissions)
* [Compiling from source](#compiling-from-source)
* [Linux (kernel 2.6 ) : (install examples shown for Debian/Ubuntu)](#linux-kernel-26--install-examples-shown-for-debianubuntu)
* [Mac OS X 10.8 ](#mac-os-x-108)
* [Windows 7, 8, 10](#windows-7-8-10)
* [Building node-hid from source, for your projects](#building-node-hid-from-source-for-your-projects)
* [Build node-hid for <code>node-hid</code> development:](#build-node-hid-for-node-hid-development)
* [Electron projects using node-hid](#electron-projects-using-node-hid)
* [NW.js projects using node-hid](#nwjs-projects-using-node-hid)
* [Support](#support)
## Platform Support

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

* Electron v1 to
* Electron v8
* Electron v9

@@ -359,15 +359,21 @@

## Mac notes
## General notes:
### Thread safety, Worker threads, Context-aware modules
In general `node-hid` is not thread-safe because the underlying C-library it wraps (`hidapi`) is not thread-safe.
However, `node-hid` is now reporting as minimally Context Aware to allow use in Electron v9+.
Until `node-hid` (or `hidapi`) is rewritten to be thread-safe, please constrain all accesses to it via a single thread.
### Keyboards and Mice
The OS will prevent USB HID keyboards or mice, or devices that appear as a keyboard to the OS (such as some barcode readers or RFID scanners). 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.
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.
## Mac notes
See General notes above Keyboards
## Windows notes
See General notes above about Keyboards
### Keyboards and Mice
The OS will prevent USB HID keyboards or mice, or devices that appear as a keyboard to the OS (such as some barcode readers or RFID scanners). 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.
### Xbox 360 Controller on Windows 10

@@ -379,2 +385,3 @@ For reasons similar to mice & keyboards it appears you can't access this controller on Windows 10.

## Linux notes
See General notes above about Keyboards

@@ -381,0 +388,0 @@ ### Selecting driver type

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc