Comparing version 3.0.0 to 3.1.0
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
5115167
261
1
+ Addedpkg-prebuilds@1.0.0(transitive)
- Removedpkg-prebuilds@0.2.1(transitive)
Updatedpkg-prebuilds@^1.0.0