Socket
Socket
Sign inDemoInstall

usb

Package Overview
Dependencies
Maintainers
3
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

usb - npm Package Compare versions

Comparing version 2.8.1 to 2.8.2

5

CHANGELOG.md
# Changelog
## [2.8.2] - 2023-03-06
### Added
- Added new `usb.pollHotplug` setting to allow users to force hotplug detection using polling - [`576`](https://github.com/node-usb/node-usb/pull/576) ([Rob Moran](https://github.com/thegecko))
## [2.8.1] - 2023-02-26

@@ -4,0 +9,0 @@

4

dist/usb/bindings.d.ts

@@ -7,2 +7,6 @@ /// <reference types="node" />

export declare function getDeviceList(): Device[];
/**
* Force polling loop for hotplug events
*/
export declare let pollHotplug: boolean;
export declare const INIT_ERROR: number;

@@ -9,0 +13,0 @@ export declare class LibUSBException extends Error {

10

dist/usb/index.js

@@ -21,10 +21,12 @@ "use strict";

Object.setPrototypeOf(usb, events_1.EventEmitter.prototype);
Object.defineProperty(usb, 'pollHotplug', {
value: false,
writable: true
});
Object.getOwnPropertyNames(device_1.ExtendedDevice.prototype).forEach(function (name) {
Object.defineProperty(usb.Device.prototype, name, Object.getOwnPropertyDescriptor(device_1.ExtendedDevice.prototype, name) || Object.create(null));
});
// Hotplug support
var hotplugSupported = usb._supportedHotplugEvents();
// Devices delta support for non-libusb hotplug events
// This methd needs to be used for attach/detach IDs (hotplugSupportType === 2) rather than a lookup because vid/pid are not unique
var hotPlugDevices = new Set();
// This method needs to be used for attach/detach IDs (hotplugSupportType === 2) rather than a lookup because vid/pid are not unique
var emitHotplugEvents = function () {

@@ -84,3 +86,5 @@ var e_1, _a, e_2, _b;

// Hotplug control
var hotplugSupported = 0;
var startHotplug = function () {
hotplugSupported = usb.pollHotplug ? 0 : usb._supportedHotplugEvents();
if (hotplugSupported !== 1) {

@@ -87,0 +91,0 @@ // Collect initial devices when not using libusb

@@ -5,3 +5,3 @@ {

"license": "MIT",
"version": "2.8.1",
"version": "2.8.2",
"main": "dist/index.js",

@@ -8,0 +8,0 @@ "engines": {

@@ -293,2 +293,8 @@ # USB Library for Node.JS

#### usb.getDeviceList()
Return a list of legacy `Device` objects for the USB devices attached to the system.
#### usb.pollHotplug
Force polling loop for hotplug events.
#### usb.setDebugLevel(level : int)

@@ -295,0 +301,0 @@ Set the libusb debug level (between 0 and 4)

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