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.5.2-alpha.1 to 2.5.2

10

CHANGELOG.md
# Changelog
## [2.5.2] - 2022-09-24
### Fixed
- Allow errors during WebUSBDevice creation to be thown - [`549`](https://github.com/node-usb/node-usb/pull/549) ([Rob Moran](https://github.com/thegecko))
- Ensure cmNotifyFilter is kept alive for the duration of the hotplug detetion on Windows - [`541`](https://github.com/node-usb/node-usb/pull/541) ([Julian Waller](https://github.com/Julusian))
### Changed
- Export all types at the top level of the package - [`544`](https://github.com/node-usb/node-usb/pull/544) ([Rob Moran](https://github.com/thegecko))
- Trimmed TypeScript source from release package - [`536`](https://github.com/node-usb/node-usb/pull/536) ([Rob Moran](https://github.com/thegecko))
## [2.5.1] - 2022-08-29

@@ -4,0 +14,0 @@

16

dist/index.d.ts

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

import { WebUSB, getWebUsb } from './webusb';
import { WebUSBDevice } from './webusb/webusb-device';
import { WebUSB } from './webusb';
import * as usb from './usb';
declare const webusb: WebUSB;
declare const getDeviceList: typeof usb.getDeviceList;
declare const useUsbDkBackend: typeof usb.useUsbDkBackend;
/**

@@ -18,2 +14,10 @@ * 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, useUsbDkBackend, getDeviceList, findByIds, findBySerialNumber, getWebUsb, webusb, WebUSB, WebUSBDevice };
declare const webusb: WebUSB;
export { usb, findByIds, findBySerialNumber, webusb };
export { Device, Transfer, DeviceEvents, getDeviceList, useUsbDkBackend, LibUSBException } from './usb';
export * from './usb/capability';
export * from './usb/descriptors';
export * from './usb/endpoint';
export * from './usb/interface';
export * from './webusb';
export * from './webusb/webusb-device';
"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]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -50,17 +60,7 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

Object.defineProperty(exports, "__esModule", { value: true });
exports.WebUSBDevice = exports.WebUSB = exports.webusb = exports.getWebUsb = exports.findBySerialNumber = exports.findByIds = exports.getDeviceList = exports.useUsbDkBackend = exports.usb = void 0;
exports.LibUSBException = exports.useUsbDkBackend = exports.getDeviceList = exports.Transfer = exports.Device = exports.webusb = exports.findBySerialNumber = exports.findByIds = exports.usb = void 0;
var util_1 = require("util");
var webusb_1 = require("./webusb");
Object.defineProperty(exports, "WebUSB", { enumerable: true, get: function () { return webusb_1.WebUSB; } });
Object.defineProperty(exports, "getWebUsb", { enumerable: true, get: function () { return webusb_1.getWebUsb; } });
var webusb_device_1 = require("./webusb/webusb-device");
Object.defineProperty(exports, "WebUSBDevice", { enumerable: true, get: function () { return webusb_device_1.WebUSBDevice; } });
var usb = require("./usb");
exports.usb = usb;
var webusb = new webusb_1.WebUSB();
exports.webusb = webusb;
var getDeviceList = usb.getDeviceList;
exports.getDeviceList = getDeviceList;
var useUsbDkBackend = usb.useUsbDkBackend;
exports.useUsbDkBackend = useUsbDkBackend;
/**

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

exports.findBySerialNumber = findBySerialNumber;
var webusb = new webusb_1.WebUSB();
exports.webusb = webusb;
// Usb types
var usb_1 = require("./usb");
Object.defineProperty(exports, "Device", { enumerable: true, get: function () { return usb_1.Device; } });
Object.defineProperty(exports, "Transfer", { enumerable: true, get: function () { return usb_1.Transfer; } });
Object.defineProperty(exports, "getDeviceList", { enumerable: true, get: function () { return usb_1.getDeviceList; } });
Object.defineProperty(exports, "useUsbDkBackend", { enumerable: true, get: function () { return usb_1.useUsbDkBackend; } });
Object.defineProperty(exports, "LibUSBException", { enumerable: true, get: function () { return usb_1.LibUSBException; } });
__exportStar(require("./usb/capability"), exports);
__exportStar(require("./usb/descriptors"), exports);
__exportStar(require("./usb/endpoint"), exports);
__exportStar(require("./usb/interface"), exports);
// WebUSB types
__exportStar(require("./webusb"), exports);
__exportStar(require("./webusb/webusb-device"), exports);
//# sourceMappingURL=index.js.map

@@ -8,3 +8,3 @@ /// <reference types="w3c-web-usb" />

private device;
static createInstance(device: usb.Device): Promise<WebUSBDevice | undefined>;
static createInstance(device: usb.Device): Promise<WebUSBDevice>;
readonly usbVersionMajor: number;

@@ -11,0 +11,0 @@ readonly usbVersionMinor: number;

@@ -80,16 +80,11 @@ "use strict";

return __awaiter(this, void 0, void 0, function () {
var instance, _a;
return __generator(this, function (_b) {
switch (_b.label) {
var instance;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_b.trys.push([0, 2, , 3]);
instance = new WebUSBDevice(device);
return [4 /*yield*/, instance.initialize()];
case 1:
_b.sent();
_a.sent();
return [2 /*return*/, instance];
case 2:
_a = _b.sent();
return [2 /*return*/, undefined];
case 3: return [2 /*return*/];
}

@@ -96,0 +91,0 @@ });

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

"license": "MIT",
"version": "2.5.2-alpha.1",
"version": "2.5.2",
"main": "dist/index.js",

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

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