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.1.3 to 2.2.0

libusb/.private/appveyor_build.sh

12

CHANGELOG.md
# Changelog
## [2.2.0] - 2022-03-25
### Added
- Added `useUsbDkBackend()` method for switching libusb backend on Windows - [`489`](https://github.com/node-usb/node-usb/pull/489) ([Rob Moran](https://github.com/thegecko))
### Changed
- Changed libusb dependency to upstream v1.0.25 - [`490`](https://github.com/node-usb/node-usb/pull/490) ([Rob Moran](https://github.com/thegecko))
### Fixed
- Shortcut getStringDescriptor() to return undefined when passed index 0 - [`487`](https://github.com/node-usb/node-usb/pull/487) ([Rob Moran](https://github.com/thegecko))
- Fixed race issue with garbage collected devices - [`492`](https://github.com/node-usb/node-usb/pull/492) ([Alba Mendez](https://github.com/mildsunrise))
## [2.1.3] - 2022-03-18

@@ -4,0 +16,0 @@

3

dist/index.d.ts

@@ -6,2 +6,3 @@ import { WebUSB, getWebUsb } from './webusb';

declare const getDeviceList: typeof usb.getDeviceList;
declare const useUsbDkBackend: typeof usb.useUsbDkBackend;
/**

@@ -18,2 +19,2 @@ * Convenience method to get the first device with the specified VID and PID, or `undefined` if no such device is present.

declare const findBySerialNumber: (serialNumber: string) => Promise<usb.Device | undefined>;
export { usb, getDeviceList, findByIds, findBySerialNumber, getWebUsb, webusb, WebUSB, WebUSBDevice };
export { usb, useUsbDkBackend, getDeviceList, findByIds, findBySerialNumber, getWebUsb, webusb, WebUSB, WebUSBDevice };

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.WebUSBDevice = exports.WebUSB = exports.webusb = exports.getWebUsb = exports.findBySerialNumber = exports.findByIds = exports.getDeviceList = exports.usb = void 0;
exports.WebUSBDevice = exports.WebUSB = exports.webusb = exports.getWebUsb = exports.findBySerialNumber = exports.findByIds = exports.getDeviceList = exports.useUsbDkBackend = exports.usb = void 0;
var util_1 = require("util");

@@ -64,2 +64,4 @@ var webusb_1 = require("./webusb");

exports.getDeviceList = getDeviceList;
var useUsbDkBackend = usb.useUsbDkBackend;
exports.useUsbDkBackend = useUsbDkBackend;
/**

@@ -66,0 +68,0 @@ * Convenience method to get the first device with the specified VID and PID, or `undefined` if no such device is present.

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

export declare function setDebugLevel(level: number): void;
/**
* Use USBDK Backend (Windows only)
*/
export declare function useUsbDkBackend(): void;
export declare function _enableHotplugEvents(): void;

@@ -18,0 +22,0 @@ export declare function _disableHotplugEvents(): void;

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

ExtendedDevice.prototype.getStringDescriptor = function (desc_index, callback) {
// Index 0 indicates null
if (desc_index === 0) {
callback();
return;
}
var langid = 0x0409;

@@ -210,0 +215,0 @@ var length = 255;

@@ -5,3 +5,3 @@ libusb 1.0 Windows binary snapshot - README

* The latest version of this snapshot can always be downloaded at: *
* https://sourceforge.net/projects/libusb/files/ *
* https://github.com/libusb/libusb/releases *
*********************************************************************

@@ -28,20 +28,2 @@

o WDK/DDK:
- The following is an example of a sources files that you can use to compile
a libusb 1.0 based console application. In this sample ..\libusb\ is the
directory where you would have copied libusb.h as well as the relevant
libusb-1.0.lib
TARGETNAME=your_app
TARGETTYPE=PROGRAM
USE_MSVCRT=1
UMTYPE=console
INCLUDES=..\libusb;$(DDK_INC_PATH)
TARGETLIBS=..\libusb\libusb-1.0.lib
SOURCES=your_app.c
- Note that if you plan to use libCMT instead of MSVCRT (USE_LIBCMT=1 instead
of USE_MSVCRT=1), you will need to recompile libusb to use libCMT. This can
easily be achieved, in the DDK environment, by running 'ddk_build /MT'
o MinGW/cygwin

@@ -60,2 +42,5 @@ - Copy libusb.h, from include/libusb-1.0/ to your default include directory,

http://windows.libusb.info
- Using the UsbDk backend is now a run-time choice rather than a compile-time
choice. For additional information, including example usage, please visit:
http://windows.libusb.info/#Driver_Installation
- The MinGW and MS generated DLLs are fully interchangeable, provided that you

@@ -62,0 +47,0 @@ use the import libs provided or generate one from the .def also provided.

Installation Instructions for Windows
*************************************
If you are compiling for MinGW or cygwin, please refer to the INSTALL file.
If you are compiling for MinGW or cygwin, please refer to the INSTALL file,
which is automatically generated by autotools (e.g. running bootstrap.sh).
If you are using Microsoft Visual Studio:
- Open the relevant solution file in /msvc:
libusb.dsw for MSVC6, libusb_2005.sln for Visual Studio 2005 or 2008,
libusb_2010.sln for Visual Studio 2010,
libusb_2012.sln for Visual Studio 2012 or later,
libusb_wince.sln for Windows CE support in Visual Studio 2005.
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.
- If you want to debug the library, uncomment the ENABLE_DEBUG_LOGGING define

@@ -16,20 +17,16 @@ in msvc\config.h

Note that if you are using Visual Studio Express, you may have to install the
Windows SDK to be able to compile the 64 bit version of the library.
Installing and building libusb via vcpkg
****************************************
If you are using the freely available Windows DDK/WDK (Driver Development Kit)
- If you want to debug the library, uncomment the ENABLE_DEBUG_LOGGING define
in msvc\config.h
- Open one of the relevant Free Build or Checked Build prompt for your target
platform
- Navigate to the msvc\ directory where the ddk_build.cmd file is located, and
run 'ddk_build'
- To produce a DLL rather than a static library, use: 'ddk_build DLL'
- To produce a static library that uses LIBCMT[d] instead of MSVCRT[d] (/MT[d]
vs /MD[d] in Visual Studio) use: 'ddk_build /MT'
You can download and install libusb using the vcpkg dependency manager:
Note that using the Windows DDK, it is possible to compile both the 32 and 64
bit versions of the library.
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.bat
./vcpkg integrate install
vcpkg install libusb
If you are building for Windows CE then you will need the Windows CE Standard 5.00 SDK.
The libusb port in vcpkg is kept up to date by Microsoft team members and
community contributors. If the version is out of date, please create an issue
or pull request (https://github.com/Microsoft/vcpkg) on the vcpkg repository.

@@ -39,9 +36,6 @@ Destination directories

The 32 bit binaries compiled either from Visual Studio or the DDK are placed in
a Win32\ directory at the root of the library
The 64 bit binaries are placed in an x64\ directory
Windows CE binaries are placed in one of the following directories, depending
on the target processor: ARMV4I, MIPSII, MIPSII_FP, MIPSIV, MIPSIV_FP, SH4 or x86.
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.
Troubleshooting

@@ -52,8 +46,5 @@ ***************

default library paths for your project points to the relevant directories.
If needed, these libraries can be obtained by installing either the latest
Windows SDK or the DDK (Links provided at the end of this file).
If needed, these libraries can be obtained by installing the latest Windows
SDK.
For Windows CE it is necessary to install the CE USB Kernel Wrapper driver for
libusb to function on a device.
Links

@@ -64,14 +55,1 @@ *****

http://windows.libusb.info
Latest Windows Driver (Development) Kit (WDK):
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=36a2630f-5d56-43b5-b996-7633f2ec14ff
Latest Microsoft Windows SDK:
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505
Windows CE Standard 5.00 SDK:
http://www.microsoft.com/en-gb/download/details.aspx?id=17310
Windows CE USB Kernel Wrapper Driver:
https://github.com/RealVNC/CEUSBKWrapper

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

"license": "MIT",
"version": "2.1.3",
"version": "2.2.0",
"main": "dist/index.js",

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

@@ -286,2 +286,5 @@ # USB Library for Node.JS

#### usb.useUsbDkBackend()
On Windows, use the USBDK backend of libusb instead of WinUSB
### Device

@@ -288,0 +291,0 @@ Represents a USB device.

@@ -8,2 +8,3 @@ import { promisify } from 'util';

const getDeviceList = usb.getDeviceList;
const useUsbDkBackend = usb.useUsbDkBackend;

@@ -61,2 +62,3 @@ /**

// Convenience methods
useUsbDkBackend,
getDeviceList,

@@ -63,0 +65,0 @@ findByIds,

@@ -29,2 +29,7 @@ // Definitions from DefinitelyTyped, thanks to:

/**
* Use USBDK Backend (Windows only)
*/
export declare function useUsbDkBackend(): void;
export declare function _enableHotplugEvents(): void;

@@ -31,0 +36,0 @@ export declare function _disableHotplugEvents(): void;

@@ -206,2 +206,8 @@ import * as usb from './bindings';

public getStringDescriptor(this: usb.Device, desc_index: number, callback: (error?: usb.LibUSBException, value?: string) => void): void {
// Index 0 indicates null
if (desc_index === 0) {
callback();
return;
}
const langid = 0x0409;

@@ -208,0 +214,0 @@ const length = 255;

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

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