Skip to content

Commit 365214d

Browse files
committed
Load hid with require
1 parent 179ad50 commit 365214d

File tree

4 files changed

+4
-16
lines changed

4 files changed

+4
-16
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"webusb"
3535
],
3636
"scripts": {
37-
"build": "rollup -c && typedoc --tsconfig ./typedoc.tsconfig.json src",
37+
"build": "rollup -c && typedoc src",
3838
"watch": "rollup -c -w"
3939
},
4040
"engines": {

src/transport/hid.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,9 @@ export class HID implements Transport {
5858
}
5959

6060
try {
61-
return import("node-hid")
62-
.then(hid => {
63-
this.device = new hid.HID(this.path);
64-
resolve();
65-
});
61+
const hid = require("node-hid");
62+
this.device = new hid.HID(this.path);
63+
resolve();
6664
} catch (ex) {
6765
reject(ex);
6866
}

tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"compilerOptions": {
33
"target": "es5",
4-
"module": "esNext",
54
"lib": [
65
"es5",
76
"dom",

typedoc.tsconfig.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)