node-hid
Advanced tools
Comparing version 2.1.1 to 2.1.2
{ | ||
"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
571
520394
+ Addeddecompress-response@6.0.0(transitive)
+ Addeddetect-libc@2.0.3(transitive)
+ Addedmimic-response@3.1.0(transitive)
+ Addednode-abi@3.65.0(transitive)
+ Addedprebuild-install@7.1.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsemver@7.6.2(transitive)
+ Addedsimple-get@4.0.1(transitive)
+ Addedstring_decoder@1.3.0(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedaproba@1.2.0(transitive)
- Removedare-we-there-yet@1.1.7(transitive)
- Removedcode-point-at@1.1.0(transitive)
- Removedconsole-control-strings@1.1.0(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removeddecompress-response@4.2.1(transitive)
- Removeddelegates@1.0.0(transitive)
- Removeddetect-libc@1.0.3(transitive)
- Removedgauge@2.7.4(transitive)
- Removedhas-unicode@2.0.1(transitive)
- Removedis-fullwidth-code-point@1.0.0(transitive)
- Removedisarray@1.0.0(transitive)
- Removedmimic-response@2.1.0(transitive)
- Removednode-abi@2.30.1(transitive)
- Removednpmlog@4.1.2(transitive)
- Removednumber-is-nan@1.0.1(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedprebuild-install@6.1.4(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsemver@5.7.2(transitive)
- Removedset-blocking@2.0.0(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedsimple-get@3.1.1(transitive)
- Removedstring-width@1.0.2(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedwide-align@1.1.5(transitive)
Updatedprebuild-install@^7.1.1