usb 3.0.0-alpha.3 → 3.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +128 -42
- package/dist/index.d.ts +14 -14
- package/dist/index.js +31 -32
- package/index.d.ts +5 -5
- package/index.js +55 -55
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -8,6 +8,9 @@ Node.JS library for communicating with USB devices.
|
|
|
8
8
|
|
|
9
9
|
This is a complete rewrite in rust using [@kevinmehall](https://github.com/kevinmehall)'s excellent [nusb library](https://docs.rs/nusb/latest/nusb) and [napi-rs](https://napi.rs/).
|
|
10
10
|
|
|
11
|
+
# License
|
|
12
|
+
[MIT](LICENSE.md)
|
|
13
|
+
|
|
11
14
|
# Prerequisites
|
|
12
15
|
|
|
13
16
|
[Node.js >= v12.22.0](https://nodejs.org), which includes `npm`.
|
|
@@ -26,7 +29,22 @@ You may need to modify your udev and permission rules in order to access your de
|
|
|
26
29
|
SUBSYSTEM=="usb", ATTR{idVendor}=="USB-VENDOR-ID", ATTR{idProduct}=="USB-PRODUCT-ID", MODE="0660", GROUP="GROUP-YOUR-USER-IS-IN"
|
|
27
30
|
```
|
|
28
31
|
|
|
29
|
-
#
|
|
32
|
+
# Getting Started
|
|
33
|
+
|
|
34
|
+
## Supported Architectures and Operating Systems
|
|
35
|
+
|
|
36
|
+
- i686-pc-windows-msvc
|
|
37
|
+
- x86_64-apple-darwin
|
|
38
|
+
- x86_64-pc-windows-msvc
|
|
39
|
+
- x86_64-unknown-linux-gnu
|
|
40
|
+
- x86_64-unknown-linux-musl
|
|
41
|
+
- aarch64-apple-darwin
|
|
42
|
+
- aarch64-pc-windows-msvc
|
|
43
|
+
- aarch64-unknown-linux-gnu
|
|
44
|
+
- aarch64-unknown-linux-musl
|
|
45
|
+
- armv7-unknown-linux-gnueabihf
|
|
46
|
+
|
|
47
|
+
## Installation
|
|
30
48
|
|
|
31
49
|
Native modules are bundled as separate optional packages, so installation should be as simple as installing the package.
|
|
32
50
|
|
|
@@ -42,27 +60,85 @@ With `yarn`:
|
|
|
42
60
|
yarn add usb
|
|
43
61
|
```
|
|
44
62
|
|
|
45
|
-
|
|
46
|
-
|
|
63
|
+
## Examples
|
|
64
|
+
Use the following examples to kickstart your development. Once you have a desired device, use the APIs below to interact with it.
|
|
47
65
|
|
|
48
|
-
|
|
49
|
-
|
|
66
|
+
### List all devices
|
|
67
|
+
```typescript
|
|
68
|
+
import { usb } from 'usb';
|
|
50
69
|
|
|
51
|
-
|
|
70
|
+
const devices = await usb.getDevices();
|
|
52
71
|
|
|
53
|
-
|
|
54
|
-
|
|
72
|
+
for (const device of devices) {
|
|
73
|
+
console.log(device); // WebUSB device
|
|
74
|
+
}
|
|
75
|
+
```
|
|
55
76
|
|
|
56
|
-
|
|
57
|
-
|
|
77
|
+
### Find device by vid/pid
|
|
78
|
+
```typescript
|
|
79
|
+
import { usb } from 'usb';
|
|
58
80
|
|
|
59
|
-
|
|
81
|
+
const device = await usb.findDeviceByIds(0x59e3, 0x0a23);
|
|
60
82
|
|
|
61
|
-
|
|
83
|
+
if (device) {
|
|
84
|
+
console.log(device); // WebUSB device
|
|
85
|
+
}
|
|
86
|
+
```
|
|
62
87
|
|
|
63
|
-
|
|
88
|
+
### Find device by SerialNumber
|
|
89
|
+
```typescript
|
|
90
|
+
import { usb } from 'usb';
|
|
91
|
+
|
|
92
|
+
const device = await usb.findDeviceBySerial('TEST_DEVICE');
|
|
93
|
+
|
|
94
|
+
if (device) {
|
|
95
|
+
console.log(device); // WebUSB device
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Watch for connect/disconnect events
|
|
100
|
+
```typescript
|
|
101
|
+
import { usb } from 'usb';
|
|
102
|
+
|
|
103
|
+
usb.addEventListener('connect', (event) => {
|
|
104
|
+
console.log('Device connected:', event.device.serialNumber);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
usb.addEventListener('disconnect', (event) => {
|
|
108
|
+
console.log('Device disconnected:', event.device.serialNumber);
|
|
109
|
+
});
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Use WebUSB approach to find a device
|
|
113
|
+
```typescript
|
|
114
|
+
import { webusb } from 'usb';
|
|
115
|
+
|
|
116
|
+
// Returns first matching device
|
|
117
|
+
const device = await webusb.requestDevice({
|
|
118
|
+
filters: [{}]
|
|
119
|
+
})
|
|
64
120
|
|
|
65
|
-
|
|
121
|
+
console.log(device); // WebUSB device
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Use WebUSB approach to find a device with custom selection method
|
|
125
|
+
```typescript
|
|
126
|
+
import { WebUSB } from 'usb';
|
|
127
|
+
|
|
128
|
+
const customWebUSB = new WebUSB({
|
|
129
|
+
// This function can return a promise which allows a UI to be displayed if required
|
|
130
|
+
devicesFound: devices => devices.find(device => device.serialNumber === 'TEST_DEVICE')
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
// Returns device based on injected 'devicesFound' function
|
|
134
|
+
const device = await customWebUSB.requestDevice({
|
|
135
|
+
filters: [{}]
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
console.log(device); // WebUSB device
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Electron
|
|
66
142
|
Please refer to the maintained example for using `node-usb` in electron:
|
|
67
143
|
|
|
68
144
|
https://github.com/node-usb/node-usb-example-electron
|
|
@@ -73,46 +149,39 @@ If using a packaging system for electron, ensure the `node-usb` library does not
|
|
|
73
149
|
- nodeGypRebuild: false
|
|
74
150
|
- npmRebuild: false
|
|
75
151
|
|
|
76
|
-
|
|
152
|
+
# APIs
|
|
153
|
+
Since `v3.0.0`, the `node-usb` API follows the WebUSB specification which can be found here:
|
|
77
154
|
|
|
78
|
-
|
|
79
|
-
Return a list of `USB` objects for the USB devices attached to the system.
|
|
80
|
-
|
|
81
|
-
### findByIds(vid, pid)
|
|
82
|
-
Convenience method to get the first device with the specified VID and PID, or `undefined` if no such device is present.
|
|
155
|
+
https://wicg.github.io/webusb/
|
|
83
156
|
|
|
84
|
-
|
|
85
|
-
Convenience method to get the device with the specified serial number, or `undefined` if no such device is present.
|
|
157
|
+
Two versions of the WebUSB API exist by default:
|
|
86
158
|
|
|
87
|
-
|
|
159
|
+
- `usb` - which exposes all functionality in an unrestricted manner (e.g. without needing to `requestDevice()` first)
|
|
160
|
+
- `webusb` - which follows the WebUSB specification exactly and requires the user to authorise devices via `requestDevice()` first.
|
|
88
161
|
|
|
89
|
-
|
|
162
|
+
You may also construct your own WebUSB (e.g. to specify a `requestDevice()` callback) using the exported `WebUSB` class.
|
|
90
163
|
|
|
91
|
-
|
|
164
|
+
Full auto-generated API documentation can be seen here:
|
|
92
165
|
|
|
93
|
-
|
|
166
|
+
https://node-usb.github.io/node-usb-rs/
|
|
94
167
|
|
|
95
|
-
|
|
168
|
+
## Implementation Status
|
|
96
169
|
|
|
97
|
-
|
|
98
|
-
- x86_64-apple-darwin
|
|
99
|
-
- x86_64-pc-windows-msvc
|
|
100
|
-
- x86_64-unknown-linux-gnu
|
|
101
|
-
- x86_64-unknown-linux-musl
|
|
102
|
-
- aarch64-apple-darwin
|
|
103
|
-
- aarch64-pc-windows-msvc
|
|
104
|
-
- aarch64-unknown-linux-gnu
|
|
105
|
-
- aarch64-unknown-linux-musl
|
|
106
|
-
- armv7-unknown-linux-gnueabihf
|
|
170
|
+
### USB
|
|
107
171
|
|
|
108
|
-
####
|
|
172
|
+
#### WebUSB Features
|
|
109
173
|
|
|
110
174
|
- [x] getDevices()
|
|
111
175
|
- [x] requestDevice()
|
|
112
176
|
|
|
113
|
-
####
|
|
177
|
+
#### Extended Features
|
|
178
|
+
|
|
179
|
+
- [x] findDeviceByIds()
|
|
180
|
+
- [x] findDeviceBySerial()
|
|
181
|
+
|
|
182
|
+
### USBDevice
|
|
114
183
|
|
|
115
|
-
|
|
184
|
+
#### WebUSB Features
|
|
116
185
|
|
|
117
186
|
- [x] usbVersionMajor
|
|
118
187
|
- [x] usbVersionMinor
|
|
@@ -147,7 +216,7 @@ https://wicg.github.io/webusb/
|
|
|
147
216
|
- [ ] isochronousTransferIn()
|
|
148
217
|
- [ ] isochronousTransferOut()
|
|
149
218
|
|
|
150
|
-
|
|
219
|
+
#### Extended Features
|
|
151
220
|
|
|
152
221
|
- [x] bus
|
|
153
222
|
- [x] address
|
|
@@ -156,11 +225,28 @@ https://wicg.github.io/webusb/
|
|
|
156
225
|
- [x] detachKernelDriver() (Linux only)
|
|
157
226
|
- [x] attachKernelDriver() (Linux only)
|
|
158
227
|
|
|
159
|
-
|
|
228
|
+
### Events
|
|
160
229
|
|
|
161
230
|
- [x] connect
|
|
162
231
|
- [x] disconnect
|
|
163
232
|
|
|
233
|
+
## Extended Functions
|
|
234
|
+
|
|
235
|
+
This library extends the WebUSB specification to add further functionality and convenience
|
|
236
|
+
|
|
237
|
+
### findDeviceByIds(vid, pid)
|
|
238
|
+
Convenience method to get the first device with the specified VID and PID, or `undefined` if no such device is present.
|
|
239
|
+
|
|
240
|
+
### findDeviceBySerial(serialNumber)
|
|
241
|
+
Convenience method to get the device with the specified serial number, or `undefined` if no such device is present.
|
|
242
|
+
|
|
243
|
+
### detachKernelDriver(interfaceNumber) (Linux only)
|
|
244
|
+
Detaches the kernel driver from the interface.
|
|
245
|
+
You may need to execute this with elevated privileges.
|
|
246
|
+
|
|
247
|
+
### attachKernelDriver(interfaceNumber) (Linux only)
|
|
248
|
+
Re-attaches the kernel driver for the interface.
|
|
249
|
+
|
|
164
250
|
# Development
|
|
165
251
|
The library is based on native rust bindings wrapping the [nusb](https://docs.rs/nusb/latest/nusb) crate.
|
|
166
252
|
|
package/dist/index.d.ts
CHANGED
|
@@ -57,28 +57,28 @@ declare class WebUSB extends EventTarget implements USB {
|
|
|
57
57
|
* @returns Promise containing an array of devices
|
|
58
58
|
*/
|
|
59
59
|
getDevices(): Promise<UsbDevice[]>;
|
|
60
|
+
/**
|
|
61
|
+
* Convenience method to get the first device with the specified VID and PID, or `undefined` if no such device is present.
|
|
62
|
+
* @param vid
|
|
63
|
+
* @param pid
|
|
64
|
+
*/
|
|
65
|
+
findDeviceByIds(vid: number, pid: number): Promise<UsbDevice | undefined>;
|
|
66
|
+
/**
|
|
67
|
+
* Convenience method to get the device with the specified serial number, or `undefined` if no such device is present.
|
|
68
|
+
* @param serialNumber
|
|
69
|
+
*/
|
|
70
|
+
findDeviceBySerial(serialNumber: string): Promise<UsbDevice | undefined>;
|
|
60
71
|
private loadDevices;
|
|
61
72
|
private quickFilter;
|
|
62
73
|
private filterDevice;
|
|
63
74
|
private isAuthorisedDevice;
|
|
64
75
|
}
|
|
65
76
|
/**
|
|
66
|
-
*
|
|
67
|
-
*/
|
|
68
|
-
declare const getDeviceList: () => Promise<UsbDevice[]>;
|
|
69
|
-
/**
|
|
70
|
-
* Convenience method to get the first device with the specified VID and PID, or `undefined` if no such device is present.
|
|
71
|
-
* @param vid
|
|
72
|
-
* @param pid
|
|
73
|
-
*/
|
|
74
|
-
declare const findByIds: (vid: number, pid: number) => Promise<UsbDevice | undefined>;
|
|
75
|
-
/**
|
|
76
|
-
* Convenience method to get the device with the specified serial number, or `undefined` if no such device is present.
|
|
77
|
-
* @param serialNumber
|
|
77
|
+
* Default USB object (allows all devices by default)
|
|
78
78
|
*/
|
|
79
|
-
declare const
|
|
79
|
+
declare const usb: WebUSB;
|
|
80
80
|
/**
|
|
81
81
|
* Default WebUSB object (mimics navigator.usb)
|
|
82
82
|
*/
|
|
83
83
|
declare const webusb: WebUSB | USB;
|
|
84
|
-
export { webusb, WebUSB, USBOptions,
|
|
84
|
+
export { usb, webusb, WebUSB, USBOptions, };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.WebUSB = exports.webusb = exports.usb = void 0;
|
|
4
4
|
const index_js_1 = require("../index.js");
|
|
5
5
|
/**
|
|
6
6
|
* Hidden
|
|
@@ -59,14 +59,16 @@ index_js_1.UsbDevice.prototype.transferOut = async function (endpointNumber, dat
|
|
|
59
59
|
/**
|
|
60
60
|
* Hidden
|
|
61
61
|
*/
|
|
62
|
-
index_js_1.UsbDevice.prototype.isochronousTransferIn = async function (
|
|
63
|
-
|
|
62
|
+
index_js_1.UsbDevice.prototype.isochronousTransferIn = async function (endpointNumber, packetLengths, timeout = DEFAULT_TIMEOUT) {
|
|
63
|
+
const res = await this.nativeIsochronousTransferIn(endpointNumber, packetLengths, timeout);
|
|
64
|
+
return res;
|
|
64
65
|
};
|
|
65
66
|
/**
|
|
66
67
|
* Hidden
|
|
67
68
|
*/
|
|
68
|
-
index_js_1.UsbDevice.prototype.isochronousTransferOut = async function (
|
|
69
|
-
|
|
69
|
+
index_js_1.UsbDevice.prototype.isochronousTransferOut = async function (endpointNumber, data, packetLengths, timeout = DEFAULT_TIMEOUT) {
|
|
70
|
+
const res = await this.nativeIsochronousTransferOut(endpointNumber, toUint8Array(data), packetLengths, timeout);
|
|
71
|
+
return res;
|
|
70
72
|
};
|
|
71
73
|
class NamedError extends Error {
|
|
72
74
|
constructor(message, name) {
|
|
@@ -120,7 +122,7 @@ class WebUSB extends EventTarget {
|
|
|
120
122
|
this.nativeEmitter.start();
|
|
121
123
|
this.nativeEmitter.addAttach(deviceConnectCallback);
|
|
122
124
|
this.nativeEmitter.addDetach(deviceDisconnectCallback);
|
|
123
|
-
|
|
125
|
+
(0, index_js_1.nativeGetDevices)().then(devices => devices.forEach(device => this.knownDevices.set(device.handle, device)));
|
|
124
126
|
}
|
|
125
127
|
set onconnect(fn) {
|
|
126
128
|
if (this._onconnect) {
|
|
@@ -210,8 +212,25 @@ class WebUSB extends EventTarget {
|
|
|
210
212
|
const devices = await this.loadDevices(preFilters);
|
|
211
213
|
return devices.filter(device => this.isAuthorisedDevice(device));
|
|
212
214
|
}
|
|
215
|
+
/**
|
|
216
|
+
* Convenience method to get the first device with the specified VID and PID, or `undefined` if no such device is present.
|
|
217
|
+
* @param vid
|
|
218
|
+
* @param pid
|
|
219
|
+
*/
|
|
220
|
+
async findDeviceByIds(vid, pid) {
|
|
221
|
+
const device = await (0, index_js_1.nativeFindDeviceByIds)(vid, pid);
|
|
222
|
+
return device || undefined;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Convenience method to get the device with the specified serial number, or `undefined` if no such device is present.
|
|
226
|
+
* @param serialNumber
|
|
227
|
+
*/
|
|
228
|
+
async findDeviceBySerial(serialNumber) {
|
|
229
|
+
const device = await (0, index_js_1.nativeFindDeviceBySerial)(serialNumber);
|
|
230
|
+
return device || undefined;
|
|
231
|
+
}
|
|
213
232
|
async loadDevices(preFilters) {
|
|
214
|
-
let devices = await
|
|
233
|
+
let devices = await (0, index_js_1.nativeGetDevices)();
|
|
215
234
|
// Pre-filter devices
|
|
216
235
|
devices = this.quickFilter(devices, preFilters);
|
|
217
236
|
return devices;
|
|
@@ -304,32 +323,12 @@ class WebUSB extends EventTarget {
|
|
|
304
323
|
}
|
|
305
324
|
exports.WebUSB = WebUSB;
|
|
306
325
|
/**
|
|
307
|
-
*
|
|
326
|
+
* Default USB object (allows all devices by default)
|
|
308
327
|
*/
|
|
309
|
-
const
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
exports.getDeviceList = getDeviceList;
|
|
314
|
-
/**
|
|
315
|
-
* Convenience method to get the first device with the specified VID and PID, or `undefined` if no such device is present.
|
|
316
|
-
* @param vid
|
|
317
|
-
* @param pid
|
|
318
|
-
*/
|
|
319
|
-
const findByIds = async (vid, pid) => {
|
|
320
|
-
const device = await (0, index_js_1.nativeFindByIds)(vid, pid);
|
|
321
|
-
return device;
|
|
322
|
-
};
|
|
323
|
-
exports.findByIds = findByIds;
|
|
324
|
-
/**
|
|
325
|
-
* Convenience method to get the device with the specified serial number, or `undefined` if no such device is present.
|
|
326
|
-
* @param serialNumber
|
|
327
|
-
*/
|
|
328
|
-
const findBySerialNumber = async (serialNumber) => {
|
|
329
|
-
const device = await (0, index_js_1.nativeFindBySerialNumber)(serialNumber);
|
|
330
|
-
return device;
|
|
331
|
-
};
|
|
332
|
-
exports.findBySerialNumber = findBySerialNumber;
|
|
328
|
+
const usb = new WebUSB({
|
|
329
|
+
allowAllDevices: true
|
|
330
|
+
});
|
|
331
|
+
exports.usb = usb;
|
|
333
332
|
/**
|
|
334
333
|
* Default WebUSB object (mimics navigator.usb)
|
|
335
334
|
*/
|
package/index.d.ts
CHANGED
|
@@ -77,18 +77,18 @@ export declare class UsbDevice {
|
|
|
77
77
|
nativeControlTransferOut(setup: USBControlTransferParameters, timeout: number, data?: Uint8Array | undefined | null): Promise<number>
|
|
78
78
|
nativeTransferIn(endpointNumber: number, timeout: number, length: number): Promise<Uint8Array | null>
|
|
79
79
|
nativeTransferOut(endpointNumber: number, timeout: number, data: Uint8Array): Promise<number>
|
|
80
|
-
nativeIsochronousTransferIn(endpointNumber: number, packetLengths: Array<number
|
|
81
|
-
nativeIsochronousTransferOut(endpointNumber: number, data: Uint8Array, packetLengths: Array<number
|
|
80
|
+
nativeIsochronousTransferIn(endpointNumber: number, packetLengths: Array<number>, timeout: number): Promise<USBIsochronousInTransferResult>
|
|
81
|
+
nativeIsochronousTransferOut(endpointNumber: number, data: Uint8Array, packetLengths: Array<number>, timeout: number): Promise<USBIsochronousOutTransferResult>
|
|
82
82
|
clearHalt(direction: USBDirection, endpointNumber: number): Promise<void>
|
|
83
83
|
detachKernelDriver(interfaceNumber: number): Promise<void>
|
|
84
84
|
attachKernelDriver(interfaceNumber: number): Promise<void>
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
export declare function
|
|
87
|
+
export declare function nativeFindDeviceByIds(vendorId: number, productId: number): Promise<UsbDevice | null>
|
|
88
88
|
|
|
89
|
-
export declare function
|
|
89
|
+
export declare function nativeFindDeviceBySerial(serialNumber: string): Promise<UsbDevice | null>
|
|
90
90
|
|
|
91
|
-
export declare function
|
|
91
|
+
export declare function nativeGetDevices(): Promise<Array<UsbDevice>>
|
|
92
92
|
|
|
93
93
|
export interface UsbAlternateInterface {
|
|
94
94
|
alternateSetting: number
|
package/index.js
CHANGED
|
@@ -77,8 +77,8 @@ function requireNative() {
|
|
|
77
77
|
try {
|
|
78
78
|
const binding = require('@node-usb/usb-android-arm64')
|
|
79
79
|
const bindingPackageVersion = require('@node-usb/usb-android-arm64/package.json').version
|
|
80
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
81
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
80
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
81
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
82
82
|
}
|
|
83
83
|
return binding
|
|
84
84
|
} catch (e) {
|
|
@@ -93,8 +93,8 @@ function requireNative() {
|
|
|
93
93
|
try {
|
|
94
94
|
const binding = require('@node-usb/usb-android-arm-eabi')
|
|
95
95
|
const bindingPackageVersion = require('@node-usb/usb-android-arm-eabi/package.json').version
|
|
96
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
97
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
96
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
97
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
98
98
|
}
|
|
99
99
|
return binding
|
|
100
100
|
} catch (e) {
|
|
@@ -114,8 +114,8 @@ function requireNative() {
|
|
|
114
114
|
try {
|
|
115
115
|
const binding = require('@node-usb/usb-win32-x64-gnu')
|
|
116
116
|
const bindingPackageVersion = require('@node-usb/usb-win32-x64-gnu/package.json').version
|
|
117
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
118
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
117
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
118
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
119
119
|
}
|
|
120
120
|
return binding
|
|
121
121
|
} catch (e) {
|
|
@@ -130,8 +130,8 @@ function requireNative() {
|
|
|
130
130
|
try {
|
|
131
131
|
const binding = require('@node-usb/usb-win32-x64-msvc')
|
|
132
132
|
const bindingPackageVersion = require('@node-usb/usb-win32-x64-msvc/package.json').version
|
|
133
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
134
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
133
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
134
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
135
135
|
}
|
|
136
136
|
return binding
|
|
137
137
|
} catch (e) {
|
|
@@ -147,8 +147,8 @@ function requireNative() {
|
|
|
147
147
|
try {
|
|
148
148
|
const binding = require('@node-usb/usb-win32-ia32-msvc')
|
|
149
149
|
const bindingPackageVersion = require('@node-usb/usb-win32-ia32-msvc/package.json').version
|
|
150
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
151
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
150
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
151
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
152
152
|
}
|
|
153
153
|
return binding
|
|
154
154
|
} catch (e) {
|
|
@@ -163,8 +163,8 @@ function requireNative() {
|
|
|
163
163
|
try {
|
|
164
164
|
const binding = require('@node-usb/usb-win32-arm64-msvc')
|
|
165
165
|
const bindingPackageVersion = require('@node-usb/usb-win32-arm64-msvc/package.json').version
|
|
166
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
167
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
166
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
167
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
168
168
|
}
|
|
169
169
|
return binding
|
|
170
170
|
} catch (e) {
|
|
@@ -182,8 +182,8 @@ function requireNative() {
|
|
|
182
182
|
try {
|
|
183
183
|
const binding = require('@node-usb/usb-darwin-universal')
|
|
184
184
|
const bindingPackageVersion = require('@node-usb/usb-darwin-universal/package.json').version
|
|
185
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
186
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
185
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
186
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
187
187
|
}
|
|
188
188
|
return binding
|
|
189
189
|
} catch (e) {
|
|
@@ -198,8 +198,8 @@ function requireNative() {
|
|
|
198
198
|
try {
|
|
199
199
|
const binding = require('@node-usb/usb-darwin-x64')
|
|
200
200
|
const bindingPackageVersion = require('@node-usb/usb-darwin-x64/package.json').version
|
|
201
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
202
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
201
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
202
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
203
203
|
}
|
|
204
204
|
return binding
|
|
205
205
|
} catch (e) {
|
|
@@ -214,8 +214,8 @@ function requireNative() {
|
|
|
214
214
|
try {
|
|
215
215
|
const binding = require('@node-usb/usb-darwin-arm64')
|
|
216
216
|
const bindingPackageVersion = require('@node-usb/usb-darwin-arm64/package.json').version
|
|
217
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
218
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
217
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
218
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
219
219
|
}
|
|
220
220
|
return binding
|
|
221
221
|
} catch (e) {
|
|
@@ -234,8 +234,8 @@ function requireNative() {
|
|
|
234
234
|
try {
|
|
235
235
|
const binding = require('@node-usb/usb-freebsd-x64')
|
|
236
236
|
const bindingPackageVersion = require('@node-usb/usb-freebsd-x64/package.json').version
|
|
237
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
238
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
237
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
238
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
239
239
|
}
|
|
240
240
|
return binding
|
|
241
241
|
} catch (e) {
|
|
@@ -250,8 +250,8 @@ function requireNative() {
|
|
|
250
250
|
try {
|
|
251
251
|
const binding = require('@node-usb/usb-freebsd-arm64')
|
|
252
252
|
const bindingPackageVersion = require('@node-usb/usb-freebsd-arm64/package.json').version
|
|
253
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
254
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
253
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
254
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
255
255
|
}
|
|
256
256
|
return binding
|
|
257
257
|
} catch (e) {
|
|
@@ -271,8 +271,8 @@ function requireNative() {
|
|
|
271
271
|
try {
|
|
272
272
|
const binding = require('@node-usb/usb-linux-x64-musl')
|
|
273
273
|
const bindingPackageVersion = require('@node-usb/usb-linux-x64-musl/package.json').version
|
|
274
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
275
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
274
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
275
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
276
276
|
}
|
|
277
277
|
return binding
|
|
278
278
|
} catch (e) {
|
|
@@ -287,8 +287,8 @@ function requireNative() {
|
|
|
287
287
|
try {
|
|
288
288
|
const binding = require('@node-usb/usb-linux-x64-gnu')
|
|
289
289
|
const bindingPackageVersion = require('@node-usb/usb-linux-x64-gnu/package.json').version
|
|
290
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
291
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
290
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
291
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
292
292
|
}
|
|
293
293
|
return binding
|
|
294
294
|
} catch (e) {
|
|
@@ -305,8 +305,8 @@ function requireNative() {
|
|
|
305
305
|
try {
|
|
306
306
|
const binding = require('@node-usb/usb-linux-arm64-musl')
|
|
307
307
|
const bindingPackageVersion = require('@node-usb/usb-linux-arm64-musl/package.json').version
|
|
308
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
309
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
308
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
309
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
310
310
|
}
|
|
311
311
|
return binding
|
|
312
312
|
} catch (e) {
|
|
@@ -321,8 +321,8 @@ function requireNative() {
|
|
|
321
321
|
try {
|
|
322
322
|
const binding = require('@node-usb/usb-linux-arm64-gnu')
|
|
323
323
|
const bindingPackageVersion = require('@node-usb/usb-linux-arm64-gnu/package.json').version
|
|
324
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
325
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
324
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
325
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
326
326
|
}
|
|
327
327
|
return binding
|
|
328
328
|
} catch (e) {
|
|
@@ -339,8 +339,8 @@ function requireNative() {
|
|
|
339
339
|
try {
|
|
340
340
|
const binding = require('@node-usb/usb-linux-arm-musleabihf')
|
|
341
341
|
const bindingPackageVersion = require('@node-usb/usb-linux-arm-musleabihf/package.json').version
|
|
342
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
343
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
342
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
343
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
344
344
|
}
|
|
345
345
|
return binding
|
|
346
346
|
} catch (e) {
|
|
@@ -355,8 +355,8 @@ function requireNative() {
|
|
|
355
355
|
try {
|
|
356
356
|
const binding = require('@node-usb/usb-linux-arm-gnueabihf')
|
|
357
357
|
const bindingPackageVersion = require('@node-usb/usb-linux-arm-gnueabihf/package.json').version
|
|
358
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
359
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
358
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
359
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
360
360
|
}
|
|
361
361
|
return binding
|
|
362
362
|
} catch (e) {
|
|
@@ -373,8 +373,8 @@ function requireNative() {
|
|
|
373
373
|
try {
|
|
374
374
|
const binding = require('@node-usb/usb-linux-loong64-musl')
|
|
375
375
|
const bindingPackageVersion = require('@node-usb/usb-linux-loong64-musl/package.json').version
|
|
376
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
377
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
376
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
377
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
378
378
|
}
|
|
379
379
|
return binding
|
|
380
380
|
} catch (e) {
|
|
@@ -389,8 +389,8 @@ function requireNative() {
|
|
|
389
389
|
try {
|
|
390
390
|
const binding = require('@node-usb/usb-linux-loong64-gnu')
|
|
391
391
|
const bindingPackageVersion = require('@node-usb/usb-linux-loong64-gnu/package.json').version
|
|
392
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
393
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
392
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
393
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
394
394
|
}
|
|
395
395
|
return binding
|
|
396
396
|
} catch (e) {
|
|
@@ -407,8 +407,8 @@ function requireNative() {
|
|
|
407
407
|
try {
|
|
408
408
|
const binding = require('@node-usb/usb-linux-riscv64-musl')
|
|
409
409
|
const bindingPackageVersion = require('@node-usb/usb-linux-riscv64-musl/package.json').version
|
|
410
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
411
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
410
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
411
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
412
412
|
}
|
|
413
413
|
return binding
|
|
414
414
|
} catch (e) {
|
|
@@ -423,8 +423,8 @@ function requireNative() {
|
|
|
423
423
|
try {
|
|
424
424
|
const binding = require('@node-usb/usb-linux-riscv64-gnu')
|
|
425
425
|
const bindingPackageVersion = require('@node-usb/usb-linux-riscv64-gnu/package.json').version
|
|
426
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
427
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
426
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
427
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
428
428
|
}
|
|
429
429
|
return binding
|
|
430
430
|
} catch (e) {
|
|
@@ -440,8 +440,8 @@ function requireNative() {
|
|
|
440
440
|
try {
|
|
441
441
|
const binding = require('@node-usb/usb-linux-ppc64-gnu')
|
|
442
442
|
const bindingPackageVersion = require('@node-usb/usb-linux-ppc64-gnu/package.json').version
|
|
443
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
444
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
443
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
444
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
445
445
|
}
|
|
446
446
|
return binding
|
|
447
447
|
} catch (e) {
|
|
@@ -456,8 +456,8 @@ function requireNative() {
|
|
|
456
456
|
try {
|
|
457
457
|
const binding = require('@node-usb/usb-linux-s390x-gnu')
|
|
458
458
|
const bindingPackageVersion = require('@node-usb/usb-linux-s390x-gnu/package.json').version
|
|
459
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
460
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
459
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
460
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
461
461
|
}
|
|
462
462
|
return binding
|
|
463
463
|
} catch (e) {
|
|
@@ -476,8 +476,8 @@ function requireNative() {
|
|
|
476
476
|
try {
|
|
477
477
|
const binding = require('@node-usb/usb-openharmony-arm64')
|
|
478
478
|
const bindingPackageVersion = require('@node-usb/usb-openharmony-arm64/package.json').version
|
|
479
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
480
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
479
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
480
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
481
481
|
}
|
|
482
482
|
return binding
|
|
483
483
|
} catch (e) {
|
|
@@ -492,8 +492,8 @@ function requireNative() {
|
|
|
492
492
|
try {
|
|
493
493
|
const binding = require('@node-usb/usb-openharmony-x64')
|
|
494
494
|
const bindingPackageVersion = require('@node-usb/usb-openharmony-x64/package.json').version
|
|
495
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
496
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
495
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
496
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
497
497
|
}
|
|
498
498
|
return binding
|
|
499
499
|
} catch (e) {
|
|
@@ -508,8 +508,8 @@ function requireNative() {
|
|
|
508
508
|
try {
|
|
509
509
|
const binding = require('@node-usb/usb-openharmony-arm')
|
|
510
510
|
const bindingPackageVersion = require('@node-usb/usb-openharmony-arm/package.json').version
|
|
511
|
-
if (bindingPackageVersion !== '3.0.0-alpha.
|
|
512
|
-
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.
|
|
511
|
+
if (bindingPackageVersion !== '3.0.0-alpha.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
512
|
+
throw new Error(`Native binding package version mismatch, expected 3.0.0-alpha.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
513
513
|
}
|
|
514
514
|
return binding
|
|
515
515
|
} catch (e) {
|
|
@@ -578,6 +578,6 @@ if (!nativeBinding) {
|
|
|
578
578
|
module.exports = nativeBinding
|
|
579
579
|
module.exports.Emitter = nativeBinding.Emitter
|
|
580
580
|
module.exports.UsbDevice = nativeBinding.UsbDevice
|
|
581
|
-
module.exports.
|
|
582
|
-
module.exports.
|
|
583
|
-
module.exports.
|
|
581
|
+
module.exports.nativeFindDeviceByIds = nativeBinding.nativeFindDeviceByIds
|
|
582
|
+
module.exports.nativeFindDeviceBySerial = nativeBinding.nativeFindDeviceBySerial
|
|
583
|
+
module.exports.nativeGetDevices = nativeBinding.nativeGetDevices
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "usb",
|
|
3
3
|
"description": "Library to access USB devices",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "3.0.0-alpha.
|
|
5
|
+
"version": "3.0.0-alpha.4",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": ">= 12.22.0 < 13 || >= 14.17.0 < 15 || >= 15.12.0 < 16 || >= 16.0.0"
|
|
@@ -84,15 +84,15 @@
|
|
|
84
84
|
"index.js"
|
|
85
85
|
],
|
|
86
86
|
"optionalDependencies": {
|
|
87
|
-
"@node-usb/usb-win32-x64-msvc": "3.0.0-alpha.
|
|
88
|
-
"@node-usb/usb-darwin-x64": "3.0.0-alpha.
|
|
89
|
-
"@node-usb/usb-linux-x64-gnu": "3.0.0-alpha.
|
|
90
|
-
"@node-usb/usb-linux-x64-musl": "3.0.0-alpha.
|
|
91
|
-
"@node-usb/usb-linux-arm64-gnu": "3.0.0-alpha.
|
|
92
|
-
"@node-usb/usb-win32-ia32-msvc": "3.0.0-alpha.
|
|
93
|
-
"@node-usb/usb-linux-arm-gnueabihf": "3.0.0-alpha.
|
|
94
|
-
"@node-usb/usb-darwin-arm64": "3.0.0-alpha.
|
|
95
|
-
"@node-usb/usb-linux-arm64-musl": "3.0.0-alpha.
|
|
96
|
-
"@node-usb/usb-win32-arm64-msvc": "3.0.0-alpha.
|
|
87
|
+
"@node-usb/usb-win32-x64-msvc": "3.0.0-alpha.4",
|
|
88
|
+
"@node-usb/usb-darwin-x64": "3.0.0-alpha.4",
|
|
89
|
+
"@node-usb/usb-linux-x64-gnu": "3.0.0-alpha.4",
|
|
90
|
+
"@node-usb/usb-linux-x64-musl": "3.0.0-alpha.4",
|
|
91
|
+
"@node-usb/usb-linux-arm64-gnu": "3.0.0-alpha.4",
|
|
92
|
+
"@node-usb/usb-win32-ia32-msvc": "3.0.0-alpha.4",
|
|
93
|
+
"@node-usb/usb-linux-arm-gnueabihf": "3.0.0-alpha.4",
|
|
94
|
+
"@node-usb/usb-darwin-arm64": "3.0.0-alpha.4",
|
|
95
|
+
"@node-usb/usb-linux-arm64-musl": "3.0.0-alpha.4",
|
|
96
|
+
"@node-usb/usb-win32-arm64-msvc": "3.0.0-alpha.4"
|
|
97
97
|
}
|
|
98
98
|
}
|