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.12.1 to 2.13.0

libusb/.codespellrc

8

CHANGELOG.md
# Changelog
## [2.13.0] - 2024-05-26
### Changed
- Updated libusb to v1.0.27 - [`773`](https://github.com/node-usb/node-usb/pull/773) ([Rob Moran](https://github.com/thegecko))
### Added
- Added nullchecks and errorchecks in descriptor parsing - [`764`](https://github.com/node-usb/node-usb/pull/764) ([Seth Foster](https://github.com/sfoster1))
## [2.12.1] - 2024-03-09

@@ -4,0 +12,0 @@

8

dist/index.js
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -40,3 +44,3 @@ if (k2 === undefined) k2 = k;

}
const getStringDescriptor = util_1.promisify(device.getStringDescriptor).bind(device);
const getStringDescriptor = (0, util_1.promisify)(device.getStringDescriptor).bind(device);
const buffer = await getStringDescriptor(device.deviceDescriptor.iSerialNumber);

@@ -43,0 +47,0 @@ if (buffer && buffer.toString() === serialNumber) {

@@ -8,4 +8,4 @@ "use strict";

/* eslint-disable @typescript-eslint/no-var-requires */
const usb = require('node-gyp-build')(path_1.join(__dirname, '..', '..'));
const usb = require('node-gyp-build')((0, path_1.join)(__dirname, '..', '..'));
module.exports = usb;
//# sourceMappingURL=bindings.js.map
/// <reference types="node" />
/// <reference types="node" />
import { EventEmitter } from 'events';

@@ -3,0 +4,0 @@ import { LibUSBException, Transfer, Device } from './bindings';

@@ -47,3 +47,3 @@ "use strict";

this.pollActive = false;
this.transferAsync = util_1.promisify(this.transfer).bind(this);
this.transferAsync = (0, util_1.promisify)(this.transfer).bind(this);
}

@@ -176,3 +176,3 @@ /**

this.direction = 'out';
this.transferAsync = util_1.promisify(this.transfer).bind(this);
this.transferAsync = (0, util_1.promisify)(this.transfer).bind(this);
}

@@ -179,0 +179,0 @@ /**

@@ -14,4 +14,4 @@ "use strict";

this.refresh();
this.releaseAsync = util_1.promisify(this.release).bind(this);
this.setAltSettingAsync = util_1.promisify(this.setAltSetting).bind(this);
this.releaseAsync = (0, util_1.promisify)(this.release).bind(this);
this.setAltSettingAsync = (0, util_1.promisify)(this.setAltSetting).bind(this);
}

@@ -18,0 +18,0 @@ refresh() {

@@ -0,3 +1,3 @@

/// <reference types="node" />
/// <reference types="w3c-web-usb" />
/// <reference types="node" />
import * as usb from '../usb';

@@ -33,3 +33,3 @@ import { EventEmitter } from 'events';

private options;
protected emitter: EventEmitter;
protected emitter: EventEmitter<[never]>;
protected knownDevices: Map<usb.Device, WebUSBDevice>;

@@ -36,0 +36,0 @@ protected authorisedDevices: Set<USBDeviceFilter>;

@@ -15,2 +15,7 @@ "use strict";

class WebUSBDevice {
static async createInstance(device) {
const instance = new WebUSBDevice(device);
await instance.initialize();
return instance;
}
constructor(device) {

@@ -32,12 +37,7 @@ this.device = device;

this.deviceVersionSubminor = deviceVersion.sub;
this.controlTransferAsync = util_1.promisify(this.device.controlTransfer).bind(this.device);
this.setConfigurationAsync = util_1.promisify(this.device.setConfiguration).bind(this.device);
this.resetAsync = util_1.promisify(this.device.reset).bind(this.device);
this.getStringDescriptorAsync = util_1.promisify(this.device.getStringDescriptor).bind(this.device);
this.controlTransferAsync = (0, util_1.promisify)(this.device.controlTransfer).bind(this.device);
this.setConfigurationAsync = (0, util_1.promisify)(this.device.setConfiguration).bind(this.device);
this.resetAsync = (0, util_1.promisify)(this.device.reset).bind(this.device);
this.getStringDescriptorAsync = (0, util_1.promisify)(this.device.getStringDescriptor).bind(this.device);
}
static async createInstance(device) {
const instance = new WebUSBDevice(device);
await instance.initialize();
return instance;
}
get configuration() {

@@ -297,3 +297,3 @@ if (!this.device.configDescriptor) {

// https://github.com/node-usb/node-usb/issues/61
if (this.deviceClass === 0xff && os_1.platform() === 'darwin') {
if (this.deviceClass === 0xff && (0, os_1.platform)() === 'darwin') {
await this.setConfigurationAsync(1);

@@ -300,0 +300,0 @@ }

@@ -18,10 +18,7 @@ libusb 1.0 Windows binary snapshot - README

-> General)
- If you use the static version of the libusb library, make sure that
'Runtime Library' is set to 'Multi-threaded DLL (/MD)' (Configuration
Properties -> C/C++ -> Code Generation).
NB: If your application requires /MT (Multi-threaded/libCMT), you need to
recompile a static libusb 1.0 library from source.
- By default, static libusb statically links against the CRT and the dll build
dynamically links against CRT. You need to rebuild libusb from source to
change this if required by your application.
- Compile and run your application. If you use the DLL version of libusb-1.0,
remember that you need to have a copy of the DLL either in the runtime
directory or in system32
remember that the DLL needs to be in the DLL search path of your application.

@@ -46,3 +43,3 @@ o MinGW/cygwin

use the import libs provided or generate one from the .def also provided.
- If you find any issue, please visit http://libusb.info/ and check the
- If you find any issue, please visit https://libusb.info/ and check the
Support section

@@ -8,10 +8,11 @@ Installation Instructions for Windows

If you are using Microsoft Visual Studio:
- Open the relevant solution file in /msvc:
libusb_2013.sln for Visual Studio 2013,
libusb_2015.sln for Visual Studio 2015,
libusb_2017.sln for Visual Studio 2017,
libusb_2019.sln for Visual Studio 2019 or later.
- Using Visual Studio 2022, open /msvc/libusb.sln
- If you want to debug the library, uncomment the ENABLE_DEBUG_LOGGING define
in msvc\config.h
- Select your configuration and compile the project
in msvc/config.h
- Select your configuration and compile the project.
- To target a specific toolset (previous version of Visual Studio), either
edit PlatformToolset in /msvc/Configuration.Base.props, or supply the value
to msbuild on the command line.
- For example, to build for VS2015 (from a different version):
msbuild -p:PlatformToolset=v140,Platform=x64,Configuration=Release libusb.sln

@@ -36,5 +37,5 @@ Installing and building libusb via vcpkg

The 32-bit binaries are placed in a Win32\ directory at the root of the
library.
The 64-bit binaries are placed in a x64\ directory.
The binaries are located at:
/build/<PlatformToolset>/<Platform>/<Configuration>/(lib|dll)/libusb-1.0.(lib|dll)
For example: /build/v143/x64/Release/dll/libusb-1.0.dll

@@ -41,0 +42,0 @@ Troubleshooting

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

"license": "MIT",
"version": "2.12.1",
"version": "2.13.0",
"main": "dist/index.js",

@@ -50,4 +50,4 @@ "engines": {

"docs": "typedoc",
"prebuild": "prebuildify --napi --strip",
"prebuild-cross": "prebuildify-cross --napi --strip",
"prebuild": "prebuildify --napi --strip --name node.napi",
"prebuild-cross": "prebuildify-cross --napi --strip --name node.napi",
"prepublishOnly": "prebuildify-ci download",

@@ -58,3 +58,3 @@ "prebuild-download": "prebuildify-ci download"

"@types/w3c-web-usb": "^1.0.6",
"node-addon-api": "^7.0.0",
"node-addon-api": "^8.0.0",
"node-gyp-build": "^4.5.0"

@@ -70,7 +70,7 @@ },

"node-gyp": "^10.0.1",
"prebuildify": "^5.0.1",
"prebuildify": "^6.0.1",
"prebuildify-ci": "^1.0.5",
"prebuildify-cross": "^5.0.0",
"typedoc": "^0.22.10",
"typescript": "~4.2.4"
"typedoc": "^0.25.13",
"typescript": "^5.4.5"
},

@@ -77,0 +77,0 @@ "binary": {

@@ -58,3 +58,3 @@ # USB Library for Node.JS

Note that the compiled Node extension includes [libusb](https://github.com/libusb/libusb), and is thus subject to the [LGPL](https://github.com/libusb/libusb/blob/master/COPYING).
Note that the compiled Node extension includes [libusb](https://github.com/libusb/libusb), and is thus subject to the [LGPL](https://github.com/libusb/libusb/blob/main/COPYING).

@@ -61,0 +61,0 @@ # Limitations

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

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

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

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

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