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 3.0.0 to 3.1.0

4

nodehid.d.ts

@@ -36,3 +36,3 @@ // Type definitions for node-hid 1.3

setNonBlocking(no_block: boolean): void
generateDeviceInfo(): Device
getDeviceInfo(): Device
}

@@ -59,3 +59,3 @@ export function devices(vid: number, pid: number): Device[]

setNonBlocking(no_block: boolean): Promise<void>
generateDeviceInfo(): Promise<Device>
getDeviceInfo(): Promise<Device>
}

@@ -62,0 +62,0 @@

@@ -99,20 +99,27 @@

self.read(function readFunc(err, data) {
if(err)
{
//Emit error and pause reading
self._paused = true;
if(!self._closing)
self.emit("error", err);
//else ignore any errors if I'm closing the device
}
else
{
//If there are no "data" listeners, we pause
if(self.listeners("data").length <= 0)
try {
if(err)
{
//Emit error and pause reading
self._paused = true;
//Keep reading if we aren't paused
if(!self._paused)
self.read(readFunc);
//Now emit the event
self.emit("data", data);
if(!self._closing)
self.emit("error", err);
//else ignore any errors if I'm closing the device
}
else
{
//If there are no "data" listeners, we pause
if(self.listeners("data").length <= 0)
self._paused = true;
//Keep reading if we aren't paused
if(!self._paused)
self.read(readFunc);
//Now emit the event
self.emit("data", data);
}
} catch (e) {
// Emit an error on the device instead of propagating to a c++ exception
setImmediate(() => {
this.emit("error", e);
});
}

@@ -180,8 +187,15 @@ });

this._raw.readStart((err, data) => {
if (err) {
if(!this._closing)
this.emit("error", err);
//else ignore any errors if I'm closing the device
} else {
this.emit("data", data);
try {
if (err) {
if(!this._closing)
this.emit("error", err);
//else ignore any errors if I'm closing the device
} else {
this.emit("data", data);
}
} catch (e) {
// Emit an error on the device instead of propagating to a c++ exception
setImmediate(() => {
this.emit("error", e);
});
}

@@ -188,0 +202,0 @@ })

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

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

"node-addon-api": "^3.2.1",
"pkg-prebuilds": "^0.2.1"
"pkg-prebuilds": "^1.0.0"
},
"devDependencies": {
"rimraf": "^2.6.2"
"rimraf": "^5.0.7"
},

@@ -49,0 +49,0 @@ "gypfile": true,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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