usb 2.17.0 → 3.0.0-alpha.2

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.
Files changed (207) hide show
  1. package/LICENSE +18 -4
  2. package/README.md +25 -516
  3. package/dist/index.d.ts +67 -13
  4. package/dist/index.js +333 -64
  5. package/index.d.ts +89 -0
  6. package/index.js +583 -0
  7. package/package.json +53 -33
  8. package/CHANGELOG.md +0 -294
  9. package/binding.gyp +0 -128
  10. package/dist/index.js.map +0 -1
  11. package/dist/usb/bindings.d.ts +0 -266
  12. package/dist/usb/bindings.js +0 -10
  13. package/dist/usb/bindings.js.map +0 -1
  14. package/dist/usb/capability.d.ts +0 -13
  15. package/dist/usb/capability.js +0 -17
  16. package/dist/usb/capability.js.map +0 -1
  17. package/dist/usb/descriptors.d.ts +0 -128
  18. package/dist/usb/descriptors.js +0 -3
  19. package/dist/usb/descriptors.js.map +0 -1
  20. package/dist/usb/device.d.ts +0 -100
  21. package/dist/usb/device.js +0 -297
  22. package/dist/usb/device.js.map +0 -1
  23. package/dist/usb/endpoint.d.ts +0 -94
  24. package/dist/usb/endpoint.js +0 -219
  25. package/dist/usb/endpoint.js.map +0 -1
  26. package/dist/usb/index.d.ts +0 -31
  27. package/dist/usb/index.js +0 -116
  28. package/dist/usb/index.js.map +0 -1
  29. package/dist/usb/interface.d.ts +0 -80
  30. package/dist/usb/interface.js +0 -133
  31. package/dist/usb/interface.js.map +0 -1
  32. package/dist/webusb/index.d.ts +0 -64
  33. package/dist/webusb/index.js +0 -295
  34. package/dist/webusb/index.js.map +0 -1
  35. package/dist/webusb/webusb-device.d.ts +0 -54
  36. package/dist/webusb/webusb-device.js +0 -434
  37. package/dist/webusb/webusb-device.js.map +0 -1
  38. package/libusb/.clang-tidy +0 -34
  39. package/libusb/.codespellrc +0 -3
  40. package/libusb/.private/README.txt +0 -5
  41. package/libusb/.private/appveyor_build.sh +0 -26
  42. package/libusb/.private/bm.sh +0 -54
  43. package/libusb/.private/ci-build.sh +0 -92
  44. package/libusb/.private/ci-container-build.sh +0 -67
  45. package/libusb/.private/post-rewrite.sh +0 -32
  46. package/libusb/.private/pre-commit.sh +0 -52
  47. package/libusb/.private/wbs.txt +0 -43
  48. package/libusb/.travis.yml +0 -58
  49. package/libusb/AUTHORS +0 -231
  50. package/libusb/COPYING +0 -504
  51. package/libusb/ChangeLog +0 -365
  52. package/libusb/HACKING +0 -25
  53. package/libusb/INSTALL_WIN.txt +0 -52
  54. package/libusb/KEYS +0 -123
  55. package/libusb/Makefile.am +0 -50
  56. package/libusb/NEWS +0 -2
  57. package/libusb/PORTING +0 -94
  58. package/libusb/README +0 -29
  59. package/libusb/README.git +0 -41
  60. package/libusb/TODO +0 -2
  61. package/libusb/Xcode/common.xcconfig +0 -92
  62. package/libusb/Xcode/config.h +0 -31
  63. package/libusb/Xcode/debug.xcconfig +0 -32
  64. package/libusb/Xcode/libusb.xcconfig +0 -21
  65. package/libusb/Xcode/libusb.xcodeproj/project.pbxproj +0 -1391
  66. package/libusb/Xcode/libusb_debug.xcconfig +0 -21
  67. package/libusb/Xcode/libusb_release.xcconfig +0 -21
  68. package/libusb/Xcode/release.xcconfig +0 -30
  69. package/libusb/android/README +0 -152
  70. package/libusb/android/config.h +0 -55
  71. package/libusb/android/examples/unrooted_android.c +0 -301
  72. package/libusb/android/examples/unrooted_android.h +0 -36
  73. package/libusb/android/jni/Android.mk +0 -23
  74. package/libusb/android/jni/Application.mk +0 -40
  75. package/libusb/android/jni/examples.mk +0 -168
  76. package/libusb/android/jni/libusb.mk +0 -60
  77. package/libusb/android/jni/tests.mk +0 -45
  78. package/libusb/appveyor.yml +0 -108
  79. package/libusb/autogen.sh +0 -10
  80. package/libusb/bootstrap.sh +0 -10
  81. package/libusb/configure.ac +0 -450
  82. package/libusb/doc/Makefile.in +0 -22
  83. package/libusb/doc/doxygen.cfg.in +0 -2571
  84. package/libusb/doc/libusb.png +0 -0
  85. package/libusb/examples/Makefile.am +0 -12
  86. package/libusb/examples/dpfp.c +0 -711
  87. package/libusb/examples/ezusb.c +0 -846
  88. package/libusb/examples/ezusb.h +0 -109
  89. package/libusb/examples/fxload.c +0 -310
  90. package/libusb/examples/hotplugtest.c +0 -147
  91. package/libusb/examples/listdevs.c +0 -73
  92. package/libusb/examples/sam3u_benchmark.c +0 -228
  93. package/libusb/examples/testlibusb.c +0 -312
  94. package/libusb/examples/xusb.c +0 -1254
  95. package/libusb/libusb/Makefile.am +0 -98
  96. package/libusb/libusb/Makefile.am.extra +0 -26
  97. package/libusb/libusb/core.c +0 -2925
  98. package/libusb/libusb/descriptor.c +0 -1558
  99. package/libusb/libusb/hotplug.c +0 -489
  100. package/libusb/libusb/io.c +0 -2865
  101. package/libusb/libusb/libusb-1.0.def +0 -199
  102. package/libusb/libusb/libusb-1.0.rc +0 -53
  103. package/libusb/libusb/libusb.h +0 -2421
  104. package/libusb/libusb/libusbi.h +0 -1535
  105. package/libusb/libusb/os/darwin_usb.c +0 -2977
  106. package/libusb/libusb/os/darwin_usb.h +0 -156
  107. package/libusb/libusb/os/emscripten_webusb.cpp +0 -875
  108. package/libusb/libusb/os/events_posix.c +0 -340
  109. package/libusb/libusb/os/events_posix.h +0 -62
  110. package/libusb/libusb/os/events_windows.c +0 -214
  111. package/libusb/libusb/os/events_windows.h +0 -46
  112. package/libusb/libusb/os/haiku_pollfs.cpp +0 -372
  113. package/libusb/libusb/os/haiku_usb.h +0 -113
  114. package/libusb/libusb/os/haiku_usb_backend.cpp +0 -532
  115. package/libusb/libusb/os/haiku_usb_raw.cpp +0 -231
  116. package/libusb/libusb/os/haiku_usb_raw.h +0 -188
  117. package/libusb/libusb/os/linux_netlink.c +0 -401
  118. package/libusb/libusb/os/linux_udev.c +0 -321
  119. package/libusb/libusb/os/linux_usbfs.c +0 -2829
  120. package/libusb/libusb/os/linux_usbfs.h +0 -221
  121. package/libusb/libusb/os/netbsd_usb.c +0 -617
  122. package/libusb/libusb/os/null_usb.c +0 -111
  123. package/libusb/libusb/os/openbsd_usb.c +0 -700
  124. package/libusb/libusb/os/sunos_usb.c +0 -1619
  125. package/libusb/libusb/os/sunos_usb.h +0 -79
  126. package/libusb/libusb/os/threads_posix.c +0 -126
  127. package/libusb/libusb/os/threads_posix.h +0 -98
  128. package/libusb/libusb/os/threads_windows.c +0 -40
  129. package/libusb/libusb/os/threads_windows.h +0 -113
  130. package/libusb/libusb/os/windows_common.c +0 -923
  131. package/libusb/libusb/os/windows_common.h +0 -424
  132. package/libusb/libusb/os/windows_usbdk.c +0 -724
  133. package/libusb/libusb/os/windows_usbdk.h +0 -106
  134. package/libusb/libusb/os/windows_winusb.c +0 -4766
  135. package/libusb/libusb/os/windows_winusb.h +0 -787
  136. package/libusb/libusb/strerror.c +0 -223
  137. package/libusb/libusb/sync.c +0 -342
  138. package/libusb/libusb/version.h +0 -18
  139. package/libusb/libusb/version_nano.h +0 -1
  140. package/libusb/libusb-1.0.pc.in +0 -11
  141. package/libusb/msvc/Base.props +0 -60
  142. package/libusb/msvc/Configuration.Application.props +0 -7
  143. package/libusb/msvc/Configuration.Base.props +0 -47
  144. package/libusb/msvc/Configuration.DynamicLibrary.props +0 -21
  145. package/libusb/msvc/Configuration.StaticLibrary.props +0 -7
  146. package/libusb/msvc/ProjectConfigurations.Base.props +0 -69
  147. package/libusb/msvc/build_all.ps1 +0 -17
  148. package/libusb/msvc/config.h +0 -58
  149. package/libusb/msvc/dpfp.vcxproj +0 -33
  150. package/libusb/msvc/dpfp_threaded.vcxproj +0 -38
  151. package/libusb/msvc/fxload.vcxproj +0 -46
  152. package/libusb/msvc/getopt/getopt.c +0 -1060
  153. package/libusb/msvc/getopt/getopt.h +0 -180
  154. package/libusb/msvc/getopt/getopt1.c +0 -188
  155. package/libusb/msvc/getopt.vcxproj +0 -33
  156. package/libusb/msvc/hotplugtest.vcxproj +0 -32
  157. package/libusb/msvc/init_context.vcxproj +0 -35
  158. package/libusb/msvc/libusb.sln +0 -542
  159. package/libusb/msvc/libusb_dll.vcxproj +0 -61
  160. package/libusb/msvc/libusb_static.vcxproj +0 -49
  161. package/libusb/msvc/listdevs.vcxproj +0 -32
  162. package/libusb/msvc/sam3u_benchmark.vcxproj +0 -33
  163. package/libusb/msvc/set_option.vcxproj +0 -35
  164. package/libusb/msvc/stress.vcxproj +0 -35
  165. package/libusb/msvc/stress_mt.vcxproj +0 -33
  166. package/libusb/msvc/testlibusb.vcxproj +0 -32
  167. package/libusb/msvc/xusb.vcxproj +0 -38
  168. package/libusb/tests/Makefile.am +0 -40
  169. package/libusb/tests/init_context.c +0 -153
  170. package/libusb/tests/libusb_testlib.h +0 -76
  171. package/libusb/tests/macos.c +0 -130
  172. package/libusb/tests/set_option.c +0 -253
  173. package/libusb/tests/stress.c +0 -172
  174. package/libusb/tests/stress_mt.c +0 -267
  175. package/libusb/tests/testlib.c +0 -184
  176. package/libusb/tests/umockdev.c +0 -1175
  177. package/libusb/tests/webusb-test-shim/index.js +0 -12
  178. package/libusb/tests/webusb-test-shim/package-lock.json +0 -50
  179. package/libusb/tests/webusb-test-shim/package.json +0 -10
  180. package/libusb.gypi +0 -154
  181. package/libusb_config/config.h +0 -1
  182. package/prebuilds/android-arm/node.napi.armv7.node +0 -0
  183. package/prebuilds/android-arm64/node.napi.armv8.node +0 -0
  184. package/prebuilds/darwin-x64+arm64/node.napi.node +0 -0
  185. package/prebuilds/linux-arm/node.napi.armv6.node +0 -0
  186. package/prebuilds/linux-arm/node.napi.armv7.node +0 -0
  187. package/prebuilds/linux-arm64/node.napi.armv8.node +0 -0
  188. package/prebuilds/linux-ia32/node.napi.node +0 -0
  189. package/prebuilds/linux-x64/node.napi.glibc.node +0 -0
  190. package/prebuilds/linux-x64/node.napi.musl.node +0 -0
  191. package/prebuilds/win32-arm64/node.napi.node +0 -0
  192. package/prebuilds/win32-ia32/node.napi.node +0 -0
  193. package/prebuilds/win32-x64/node.napi.node +0 -0
  194. package/src/device.cc +0 -439
  195. package/src/helpers.h +0 -64
  196. package/src/hotplug/hotplug.h +0 -22
  197. package/src/hotplug/libusb.cc +0 -90
  198. package/src/hotplug/windows.cc +0 -168
  199. package/src/node_usb.cc +0 -314
  200. package/src/node_usb.h +0 -131
  201. package/src/thread_name.cc +0 -79
  202. package/src/thread_name.h +0 -11
  203. package/src/transfer.cc +0 -143
  204. package/src/uv_async_queue.h +0 -41
  205. package/test/usb.coffee +0 -250
  206. package/test/webusb.coffee +0 -227
  207. package/test/worker.cjs +0 -13
package/package.json CHANGED
@@ -2,14 +2,18 @@
2
2
  "name": "usb",
3
3
  "description": "Library to access USB devices",
4
4
  "license": "MIT",
5
- "version": "2.17.0",
5
+ "version": "3.0.0-alpha.2",
6
6
  "main": "dist/index.js",
7
7
  "engines": {
8
- "node": ">=12.22.0 <13.0 || >=14.17.0"
8
+ "node": ">= 12.22.0 < 13 || >= 14.17.0 < 15 || >= 15.12.0 < 16 || >= 16.0.0"
9
9
  },
10
10
  "repository": {
11
11
  "type": "git",
12
- "url": "https://github.com/node-usb/node-usb.git"
12
+ "url": "https://github.com/node-usb/node-usb-rs.git"
13
+ },
14
+ "publishConfig": {
15
+ "registry": "https://registry.npmjs.org/",
16
+ "access": "public"
13
17
  },
14
18
  "contributors": [
15
19
  {
@@ -36,43 +40,59 @@
36
40
  "hardware"
37
41
  ],
38
42
  "scripts": {
39
- "install": "node-gyp-build",
40
- "rebuild": "node-gyp rebuild",
41
- "clean": "git clean -fx ./build ./prebuilds ./dist ./docs ./node_modules",
42
- "compile": "tsc",
43
- "postcompile": "eslint . --ext .ts",
44
- "watch": "tsc -w --preserveWatchOutput",
45
- "test": "mocha --require coffeescript/register --grep Module test/*",
43
+ "clean": "git clean -fx ./dist ./target ./node_modules ./npm",
44
+ "artifacts": "napi artifacts",
45
+ "build": "napi build --platform --release",
46
+ "build:ts": "tsc",
47
+ "build:all": "npm run build && npm run build:ts",
46
48
  "full-test": "mocha --timeout 10000 --require coffeescript/register test/*.coffee",
47
- "valgrind": "coffee -c test/*.coffee; valgrind --leak-check=full --show-possibly-lost=no node --expose-gc --trace-gc node_modules/mocha/bin/_mocha -R spec",
48
- "docs": "typedoc",
49
- "prebuild": "prebuildify --napi --strip --name node.napi",
50
- "prebuild-cross": "prebuildify-cross --napi --strip --name node.napi",
51
- "prepublishOnly": "prebuildify-ci download",
52
- "prebuild-download": "prebuildify-ci download"
49
+ "prepublishOnly": "napi prepublish -t npm",
50
+ "preversion": "napi build --platform && git add .",
51
+ "version": "napi version",
52
+ "create-npm-dirs": "napi create-npm-dirs",
53
+ "docs": "typedoc"
53
54
  },
54
55
  "dependencies": {
55
- "@types/w3c-web-usb": "^1.0.6",
56
- "node-addon-api": "^8.0.0",
57
- "node-gyp-build": "^4.5.0"
56
+ "@types/w3c-web-usb": "^1.0.13"
58
57
  },
59
58
  "devDependencies": {
60
- "@types/node": "^25.0.3",
61
- "@typescript-eslint/eslint-plugin": "^5.45.1",
62
- "@typescript-eslint/parser": "^5.45.1",
59
+ "@napi-rs/cli": "^3.2.0",
60
+ "@types/node": "^25.0.10",
63
61
  "coffeescript": "^2.7.0",
64
- "eslint": "^8.29.0",
65
- "mocha": "^11.0.1",
66
- "node-gyp": "^10.0.1",
67
- "prebuildify": "^6.0.1",
68
- "prebuildify-ci": "^1.0.5",
69
- "prebuildify-cross": "^5.1.1",
70
- "typedoc": "^0.28.0",
62
+ "mocha": "^11.7.5",
63
+ "typedoc": "^0.28.16",
71
64
  "typescript": "^5.9.3"
72
65
  },
73
- "binary": {
74
- "napi_versions": [
75
- 8
66
+ "napi": {
67
+ "binaryName": "usb",
68
+ "packageName": "@node-usb/usb",
69
+ "targets": [
70
+ "x86_64-pc-windows-msvc",
71
+ "x86_64-apple-darwin",
72
+ "x86_64-unknown-linux-gnu",
73
+ "x86_64-unknown-linux-musl",
74
+ "aarch64-unknown-linux-gnu",
75
+ "i686-pc-windows-msvc",
76
+ "armv7-unknown-linux-gnueabihf",
77
+ "aarch64-apple-darwin",
78
+ "aarch64-unknown-linux-musl",
79
+ "aarch64-pc-windows-msvc"
76
80
  ]
81
+ },
82
+ "files": [
83
+ "index.d.ts",
84
+ "index.js"
85
+ ],
86
+ "optionalDependencies": {
87
+ "@node-usb/usb-win32-x64-msvc": "3.0.0-alpha.2",
88
+ "@node-usb/usb-darwin-x64": "3.0.0-alpha.2",
89
+ "@node-usb/usb-linux-x64-gnu": "3.0.0-alpha.2",
90
+ "@node-usb/usb-linux-x64-musl": "3.0.0-alpha.2",
91
+ "@node-usb/usb-linux-arm64-gnu": "3.0.0-alpha.2",
92
+ "@node-usb/usb-win32-ia32-msvc": "3.0.0-alpha.2",
93
+ "@node-usb/usb-linux-arm-gnueabihf": "3.0.0-alpha.2",
94
+ "@node-usb/usb-darwin-arm64": "3.0.0-alpha.2",
95
+ "@node-usb/usb-linux-arm64-musl": "3.0.0-alpha.2",
96
+ "@node-usb/usb-win32-arm64-msvc": "3.0.0-alpha.2"
77
97
  }
78
- }
98
+ }
package/CHANGELOG.md DELETED
@@ -1,294 +0,0 @@
1
- # Changelog
2
-
3
- ## [2.17.0] - 2026-01-18
4
-
5
- ### Changed
6
- - Updated libusb to v1.0.29 - [`926`](https://github.com/node-usb/node-usb/pull/926) ([Rob Moran](https://github.com/thegecko))
7
-
8
- ### Fixed
9
- - Dependency updates seem to have fixed TypeScript build error - [`907`](https://github.com/node-usb/node-usb/issues/907) ([Rob Moran](https://github.com/thegecko))
10
-
11
- ## [2.16.0] - 2025-07-16
12
-
13
- ### Fixed
14
- - Turned off `device.setAutoDetachKernelDriver` on Windows as this is unsupported - [`870`](https://github.com/node-usb/node-usb/pull/870) ([Rob Moran](https://github.com/thegecko))
15
-
16
- ## [2.15.0] - 2025-02-21
17
-
18
- ### Added
19
- - Added support for `device.setAutoDetachKernelDriver` and set this to true for all devices in the WebUSB API - [`859`](https://github.com/node-usb/node-usb/pull/859) ([Rob Moran](https://github.com/thegecko))
20
-
21
- ## [2.14.0] - 2024-09-15
22
-
23
- ### Fixed
24
- - Fixed fatal exceptions by using `ThrowAsJavaScriptException` instead of `Napi::Error::Fatal` - [`817`](https://github.com/node-usb/node-usb/pull/817) ([cleoo](https://github.com/cleoo))
25
-
26
- ## [2.13.0] - 2024-05-26
27
-
28
- ### Changed
29
- - Updated libusb to v1.0.27 - [`773`](https://github.com/node-usb/node-usb/pull/773) ([Rob Moran](https://github.com/thegecko))
30
-
31
- ### Added
32
- - Added nullchecks and errorchecks in descriptor parsing - [`764`](https://github.com/node-usb/node-usb/pull/764) ([Seth Foster](https://github.com/sfoster1))
33
-
34
- ## [2.12.1] - 2024-03-09
35
-
36
- ### Changed
37
- - Rolled back prebuildify to 5.0.1 to avoid naming issue - [`744`](https://github.com/node-usb/node-usb/pull/744) ([Rob Moran](https://github.com/thegecko))
38
-
39
- ## [2.12.0] - 2024-03-02
40
-
41
- ### Added
42
- - Added prebuilt binary for Windows Arm64 - [`735`](https://github.com/node-usb/node-usb/pull/735) ([Rob Moran](https://github.com/thegecko))
43
- - Added exception handling - [`738`](https://github.com/node-usb/node-usb/pull/738) ([Rob Moran](https://github.com/thegecko))
44
- - Added exception when trying to transfer and device is closed - [`715`](https://github.com/node-usb/node-usb/pull/715) ([Rob Moran](https://github.com/thegecko))
45
-
46
- ### Changed
47
- - Precreate async transfer functions to increase speed - [`725`](https://github.com/node-usb/node-usb/pull/725) ([Cosmin Tanislav](https://github.com/Demon000))
48
- - Precreate all other async functions to increase speed - [`730`](https://github.com/node-usb/node-usb/pull/730) ([Rob Moran](https://github.com/thegecko))
49
-
50
- ### Fixed
51
- - Explicitly set configuration in WebUSB for vendor-specific devices on macos - [`739`](https://github.com/node-usb/node-usb/pull/739) ([Jouni Airaksinen](https://github.com/jounii))
52
- - Handle exception when loading library on WSL - [`726`](https://github.com/node-usb/node-usb/pull/726) ([Julian Waller](https://github.com/Julusian))
53
- - Comment typo fix - [`723`](https://github.com/node-usb/node-usb/pull/723) ([koji](https://github.com/koji))
54
-
55
- ## [2.11.0] - 2023-10-02
56
-
57
- ### Fixed
58
- - Allow use of close on a closed device - [`676`](https://github.com/node-usb/node-usb/pull/676) ([Julien Vanier](https://github.com/monkbroc))
59
-
60
- ## [2.10.0] - 2023-08-22
61
-
62
- ### Fixed
63
- - Fixed using callbacks in startPolling - [`631`](https://github.com/node-usb/node-usb/pull/631) ([Tim Strazzere](https://github.com/strazzere))
64
-
65
- ## [2.9.0] - 2023-03-16
66
-
67
- ### Changed
68
- - Updated node-addon-api to v6.0 - [`581`](https://github.com/node-usb/node-usb/pull/581) ([Maarten Bent](https://github.com/MaartenBent))
69
-
70
- ## [2.8.3] - 2023-03-09
71
-
72
- ### Fixed
73
- - Fixed Windows X86 crash with USB detection - [`578`](https://github.com/node-usb/node-usb/pull/578) ([Julian Waller](https://github.com/Julusian))
74
- - Fixed Windows USB detection race condition with delay - [`577`](https://github.com/node-usb/node-usb/pull/577) ([Rob Moran](https://github.com/thegecko))
75
-
76
- ## [2.8.2] - 2023-03-06
77
-
78
- ### Added
79
- - Added new `usb.pollHotplug` setting to allow users to force hotplug detection using polling - [`576`](https://github.com/node-usb/node-usb/pull/576) ([Rob Moran](https://github.com/thegecko))
80
-
81
- ## [2.8.1] - 2023-02-26
82
-
83
- ### Changed
84
- - Reworked WebUSB options.allowedDevices to allow pre-authorisation using any filter - [`574`](https://github.com/node-usb/node-usb/pull/574) ([Rob Moran](https://github.com/thegecko))
85
- - Updated requestDevice errors to use correct names - [`575`](https://github.com/node-usb/node-usb/pull/575) ([Rob Moran](https://github.com/thegecko))
86
-
87
- ## [2.8.0] - 2023-02-11
88
-
89
- ### Changed
90
- - Minor tweaks to avoid some race conditions - [`569`](https://github.com/node-usb/node-usb/pull/569) ([Rob Moran](https://github.com/thegecko))
91
-
92
- ## [2.7.0] - 2023-01-25
93
-
94
- ### Fixed
95
- - Return same WebUSB device on subsequent calls - [`567`](https://github.com/node-usb/node-usb/pull/567) ([Nisarg Jhaveri](https://github.com/nisargjhaveri))
96
-
97
- ## [2.6.0] - 2022-12-10
98
-
99
- ### Changed
100
- - Updated build dependencies and now using Python 3.x for builds (shouldn't affect package) - [`563`](https://github.com/node-usb/node-usb/pull/563) ([Rob Moran](https://github.com/thegecko))
101
-
102
- ## [2.5.3] - 2022-12-06
103
-
104
- ### Changed
105
- - Allow multiple polling to fail - [`556`](https://github.com/node-usb/node-usb/pull/556) ([Tim Strazzere](https://github.com/strazzere))
106
- - Ignore creation issues during attach and list - [`550`](https://github.com/node-usb/node-usb/pull/550) ([Rob Moran](https://github.com/thegecko))
107
-
108
- ## [2.5.2] - 2022-09-24
109
-
110
- ### Fixed
111
- - Allow errors during WebUSBDevice creation to be thown - [`549`](https://github.com/node-usb/node-usb/pull/549) ([Rob Moran](https://github.com/thegecko))
112
- - 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))
113
-
114
- ### Changed
115
- - 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))
116
- - Trimmed TypeScript source from release package - [`536`](https://github.com/node-usb/node-usb/pull/536) ([Rob Moran](https://github.com/thegecko))
117
-
118
- ## [2.5.1] - 2022-08-29
119
-
120
- ### Fixed
121
- - USB device plug/unplug detection on Windows when devce already attached - [`531`](https://github.com/node-usb/node-usb/pull/531) ([Rob Moran](https://github.com/thegecko))
122
- - Removed dependency on yarn in package.json scripts - [`535`](https://github.com/node-usb/node-usb/pull/535) ([Rob Moran](https://github.com/thegecko))
123
-
124
- ## [2.5.0] - 2022-07-30
125
-
126
- ### Fixed
127
- - Native USB device plug/unplug detection on Windows - [`524`](https://github.com/node-usb/node-usb/pull/524) ([Julian Waller](https://github.com/Julusian))
128
-
129
- ## [2.4.3] - 2022-06-21
130
-
131
- ### Fixed
132
- - Fixed poll transfer tracking - [`522`](https://github.com/node-usb/node-usb/pull/522) ([Rob Moran](https://github.com/thegecko))
133
-
134
- ## [2.4.2] - 2022-05-27
135
-
136
- ### Fixed
137
- - Fixed multiple events with device detection on Windows - [`512`](https://github.com/node-usb/node-usb/pull/512) ([Alba Mendez](https://github.com/mildsunrise))
138
-
139
- ## [2.4.1] - 2022-05-07
140
-
141
- ### Fixed
142
- - Fixed node engine ranges in package.json - ([Rob Moran](https://github.com/thegecko))
143
-
144
- ## [2.4.0] - 2022-05-02
145
-
146
- ### Fixed
147
- - Made addon context aware - [`512`](https://github.com/node-usb/node-usb/pull/512) ([Rob Moran](https://github.com/thegecko) & [Alba Mendez](https://github.com/mildsunrise))
148
- - Fixed deprecation of `libusb_set_option` - [`510`](https://github.com/node-usb/node-usb/pull/510) ([Rob Moran](https://github.com/thegecko))
149
-
150
- ### Changed
151
- - **Breaking:** Updated to N-API version 6 (Node >=10.20.0 <11.x, >=12.17.0 <13.0, >=14.0.0) - [`509`](https://github.com/node-usb/node-usb/pull/509) ([Rob Moran](https://github.com/thegecko))
152
-
153
- ### Added
154
- - Added `rebuild` command - [`511`](https://github.com/node-usb/node-usb/pull/511) ([Rob Moran](https://github.com/thegecko))
155
-
156
- ### Removed
157
- - Removed `USE_POLL` build definition to simplify code - [`507`](https://github.com/node-usb/node-usb/pull/507) ([Rob Moran](https://github.com/thegecko))
158
-
159
- ## [2.3.1] - 2022-04-11
160
-
161
- ### Changed
162
- - Removed device access mutex from WebUSB API - [`501`](https://github.com/node-usb/node-usb/pull/501) ([Rob Moran](https://github.com/thegecko))
163
-
164
- ## [2.3.0] - 2022-04-11
165
-
166
- ### Changed
167
- - Changed libusb dependency to upstream v1.0.26 - [`505`](https://github.com/node-usb/node-usb/pull/505) ([Rob Moran](https://github.com/thegecko))
168
- - Cleaned up Windows device polling method - [`496`](https://github.com/node-usb/node-usb/pull/496) ([Alba Mendez](https://github.com/mildsunrise))
169
-
170
- ## [2.2.0] - 2022-03-25
171
-
172
- ### Added
173
- - 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))
174
-
175
- ### Changed
176
- - Changed libusb dependency to upstream v1.0.25 - [`490`](https://github.com/node-usb/node-usb/pull/490) ([Rob Moran](https://github.com/thegecko))
177
-
178
- ### Fixed
179
- - 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))
180
- - Fixed race issue with garbage collected devices - [`492`](https://github.com/node-usb/node-usb/pull/492) ([Alba Mendez](https://github.com/mildsunrise))
181
-
182
- ## [2.1.3] - 2022-03-18
183
-
184
- ### Fixed
185
- - Fixed update to @types/w3c-web-usb - [`485`](https://github.com/node-usb/node-usb/pull/485) ([Rob Moran](https://github.com/thegecko))
186
-
187
- ## [2.1.2] - 2022-02-09
188
-
189
- ### Fixed
190
- - Fixed error being thrown when searching for interface endpoint - [`479`](https://github.com/node-usb/node-usb/pull/479) ([Rob Moran](https://github.com/thegecko))
191
-
192
- ## [2.1.1] - 2022-02-07
193
-
194
- ### Fixed
195
- - Fixed prebuildify tags which lead to missing binaries - [`477`](https://github.com/node-usb/node-usb/pull/477) ([Rob Moran](https://github.com/thegecko))
196
-
197
- ## [2.1.0] - 2022-01-29
198
-
199
- ### Added
200
- - Added `getWebUsb()` convenience method - [`467`](https://github.com/node-usb/node-usb/pull/467) ([Rob Moran](https://github.com/thegecko))
201
- - Added initialize() error - [`470`](https://github.com/node-usb/node-usb/pull/470) ([Gerrit Niezen](https://github.com/gniezen))
202
-
203
- ### Fixed
204
- - Fixed lack of universal binary for MacOS darwin arm64 - [`473`](https://github.com/node-usb/node-usb/pull/473) ([Rob Moran](https://github.com/thegecko))
205
-
206
- ## [2.0.3] - 2021-12-13
207
-
208
- ### Added
209
- - Added definition for `NAPI_VERSION 4` and added N-API v4 target to prebuildify - ([Rob Moran](https://github.com/thegecko))
210
-
211
- ## [2.0.2] - 2021-12-12
212
-
213
- ### Fixed
214
- - Fixed error with trying to close WebUSB devices after they had failed to open - ([Rob Moran](https://github.com/thegecko))
215
-
216
- ## [2.0.1] - 2021-12-11
217
-
218
- ### Added
219
- - Added new WebUSB API - [`443`](https://github.com/node-usb/node-usb/pull/443) ([Rob Moran](https://github.com/thegecko))
220
- - Switched to TypeScript
221
- - Switched to yarn instead of npm
222
- - Added docs using Typedoc
223
-
224
- ## [1.9.2] - 2021-12-05
225
-
226
- ### Fixed
227
- - Fixed exit delay and hang by moving queue start/stop to device open/close - [`460`](https://github.com/node-usb/node-usb/pull/460) ([MikeColeGuru](https://github.com/MikeColeGuru))
228
-
229
- ## [1.9.1] - 2021-11-14
230
-
231
- ### Fixed
232
- - Reverted fix for exit delay fixing a segfault issue it introduced - [`456`](https://github.com/node-usb/node-usb/pull/456) ([Rob Moran](https://github.com/thegecko))
233
-
234
- ## [1.9.0] - 2021-11-08
235
-
236
- ### Changed
237
- - Changed libusb dependency to upstream v1.0.23 - [`453`](https://github.com/node-usb/node-usb/pull/453) ([Rob Moran](https://github.com/thegecko))
238
-
239
- ## [1.8.1] - 2021-11-08
240
-
241
- ### Added
242
- - Added functionality to ref/unref the hotplug events - [`455`](https://github.com/node-usb/node-usb/pull/455) ([Guilherme Francescon](https://github.com/gfcittolin))
243
- - Added CHANGELOG - [`454`](https://github.com/node-usb/node-usb/pull/454) ([Rob Moran](https://github.com/thegecko))
244
-
245
- ### Fixed
246
- - Fixed delay when exiting program - [`455`](https://github.com/node-usb/node-usb/pull/455) ([Rob Moran](https://github.com/thegecko))
247
-
248
- ## [1.8.0] - 2021-10-14
249
-
250
- ### Added
251
- - Added prebuildify and GitHub action for native binaries - [`450`](https://github.com/node-usb/node-usb/pull/450) ([Rob Moran](https://github.com/thegecko))
252
-
253
- ### Fixed
254
- - Fixed crash after wake on Windows when using Electron - [`451`](https://github.com/node-usb/node-usb/pull/451) ([Rob Moran](https://github.com/thegecko))
255
- - Fixed invalid initial refs - [`445`](https://github.com/node-usb/node-usb/pull/445) ([Alba Mendez](https://github.com/mildsunrise))
256
-
257
- ### Changed
258
- - Changed GitHub organisation to [node-usb](https://github.com/node-usb) - [`447`](https://github.com/node-usb/node-usb/pull/447) ([Rob Moran](https://github.com/thegecko))
259
-
260
- ## [1.7.2] - 2021-08-30
261
-
262
- ### Fixed
263
- - Fixed crash when exiting on MacOS with Electron 9 - [`440`](https://github.com/node-usb/node-usb/pull/440) ([Daniel Main](https://github.com/danielmain))
264
-
265
- ### Changed
266
- - **Breaking:** Changed minimum Node.js version to `10` - [`428`](https://github.com/node-usb/node-usb/pull/428) ([Rob Moran](https://github.com/thegecko))
267
-
268
- ## [1.7.1] - 2021-05-08
269
-
270
- ### Fixed
271
- - Fixed compiler warnings - [`419`](https://github.com/node-usb/node-usb/pull/419) ([Joel Purra](https://github.com/joelpurra))
272
-
273
- ## [1.7.0] - 2021-04-10
274
-
275
- ### Changed
276
- - Changed native support to use Node Addon API - [`399`](https://github.com/node-usb/node-usb/pull/399) ([Georg Vienna](https://github.com/geovie))
277
-
278
- ## [1.6.5] - 2021-02-14
279
-
280
- ### Changed
281
- - Changed prebuild for Electron 12 beta to nightly - [`410`](https://github.com/node-usb/node-usb/pull/410) ([Piotr Rogowski](https://github.com/karniv00l))
282
-
283
- ### Removed
284
- - Removed `portNumbers` test on arm64 - [`408`](https://github.com/node-usb/node-usb/pull/408) ([Rob Moran](https://github.com/thegecko))
285
-
286
- ## [1.6.4] - 2021-01-30
287
-
288
- ### Added
289
- - Added prebuild for Electron 10 and 12 beta - [`407`](https://github.com/node-usb/node-usb/pull/407) ([Rob Moran](https://github.com/thegecko))
290
- - Added prebuild for Electron 9 - [`362`](https://github.com/node-usb/node-usb/pull/362) (Luke Whyte)
291
-
292
- ### Changed
293
- - Changed to GitHub Actions for prebuild workflow - [`404`](https://github.com/node-usb/node-usb/pull/404) ([Rob Moran](https://github.com/thegecko))
294
- - Changed Node.js 13 prebuild target to Node.js 14 - [`374`](https://github.com/node-usb/node-usb/pull/374) ([Micah Zoltu](https://github.com/MicahZoltu))
package/binding.gyp DELETED
@@ -1,128 +0,0 @@
1
- {
2
- 'variables': {
3
- 'use_udev%': 1,
4
- 'use_system_libusb%': 'false'
5
- },
6
- 'dependencies': [
7
- "<!(node -p \"require('node-addon-api').targets\"):node_addon_api_except"
8
- ],
9
- 'targets': [
10
- {
11
- 'target_name': 'usb_bindings',
12
- 'cflags!': [
13
- '-fno-exceptions'
14
- ],
15
- 'cflags_cc!': [
16
- '-fno-exceptions'
17
- ],
18
- 'xcode_settings': {
19
- 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
20
- 'CLANG_CXX_LIBRARY': 'libc++',
21
- 'MACOSX_DEPLOYMENT_TARGET': '10.7'
22
- },
23
- 'msvs_settings': {
24
- 'VCCLCompilerTool': {
25
- 'ExceptionHandling': 1
26
- }
27
- },
28
- 'sources': [
29
- 'src/node_usb.cc',
30
- 'src/device.cc',
31
- 'src/transfer.cc',
32
- 'src/thread_name.cc'
33
- ],
34
- 'cflags_cc': [
35
- '-std=c++14'
36
- ],
37
- 'defines': [
38
- '_FILE_OFFSET_BITS=64',
39
- '_LARGEFILE_SOURCE',
40
- 'NAPI_VERSION=8'
41
- ],
42
- 'include_dirs+': [
43
- 'src/',
44
- "<!@(node -p \"require('node-addon-api').include\")"
45
- ],
46
- 'conditions' : [
47
- ['use_system_libusb=="false" and OS!="freebsd"', {
48
- 'dependencies': [
49
- 'libusb.gypi:libusb',
50
- ]
51
- }],
52
- ['use_system_libusb=="true" or OS=="freebsd"', {
53
- 'include_dirs+': [
54
- '<!@(pkg-config libusb-1.0 --cflags-only-I | sed s/-I//g)'
55
- ],
56
- 'libraries': [
57
- '<!@(pkg-config libusb-1.0 --libs)'
58
- ]
59
- }],
60
- ['OS=="mac"', {
61
- 'xcode_settings': {
62
- 'OTHER_CFLAGS': [
63
- '-std=c++1y',
64
- '-stdlib=libc++',
65
- '-arch x86_64',
66
- '-arch arm64'
67
- ],
68
- 'OTHER_LDFLAGS': [
69
- '-framework', 'CoreFoundation',
70
- '-framework', 'IOKit',
71
- '-framework', 'Security',
72
- '-arch x86_64',
73
- '-arch arm64'
74
- ],
75
- 'SDKROOT': 'macosx',
76
- 'MACOSX_DEPLOYMENT_TARGET': '10.7'
77
- }
78
- }],
79
- ['OS!="win"', {
80
- 'sources': [
81
- 'src/hotplug/libusb.cc'
82
- ],
83
- }],
84
- ['OS=="win"', {
85
- 'sources': [
86
- 'src/hotplug/windows.cc'
87
- ],
88
- 'defines':[
89
- 'WIN32_LEAN_AND_MEAN'
90
- ],
91
- 'libraries': [
92
- 'cfgmgr32.lib'
93
- ],
94
- 'default_configuration': 'Debug',
95
- 'configurations': {
96
- 'Debug': {
97
- 'defines': [
98
- 'DEBUG',
99
- '_DEBUG'
100
- ],
101
- 'msvs_settings': {
102
- 'VCCLCompilerTool': {
103
- 'RuntimeLibrary': 1, # static debug
104
- }
105
- }
106
- },
107
- 'Release': {
108
- 'defines': [
109
- 'NDEBUG'
110
- ],
111
- 'msvs_settings': {
112
- 'VCCLCompilerTool': {
113
- 'RuntimeLibrary': 0, # static release
114
- }
115
- }
116
- }
117
- },
118
- 'msvs_settings': {
119
- 'VCCLCompilerTool': {
120
- 'AdditionalOptions': [ '/EHsc' ]
121
- }
122
- }
123
- }
124
- ]
125
- ]
126
- }
127
- ]
128
- }
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../tsc/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,+BAAiC;AACjC,qCAAkC;AAClC,6BAA6B;AAoDzB,kBAAG;AAlDP;;;;GAIG;AACH,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,GAAW,EAA0B,EAAE;IACnE,MAAM,OAAO,GAAG,GAAG,CAAC,aAAa,EAAE,CAAC;IACpC,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,KAAK,GAAG,IAAI,IAAI,CAAC,gBAAgB,CAAC,SAAS,KAAK,GAAG,CAAC,CAAC;AACnH,CAAC,CAAC;AA6CE,8BAAS;AA3Cb;;;GAGG;AACH,MAAM,kBAAkB,GAAG,KAAK,EAAE,YAAoB,EAAmC,EAAE;IACvF,MAAM,OAAO,GAAG,GAAG,CAAC,aAAa,EAAE,CAAC;IACpC,MAAM,MAAM,GAAG,CAAC,MAAkB,EAAW,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC;IAEpE,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC3B,IAAI,CAAC;YACD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;gBAClB,MAAM,CAAC,IAAI,EAAE,CAAC;YAClB,CAAC;YAED,MAAM,mBAAmB,GAAG,IAAA,gBAAS,EAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC/E,MAAM,MAAM,GAAG,MAAM,mBAAmB,CAAC,MAAM,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;YAEhF,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,EAAE,KAAK,YAAY,EAAE,CAAC;gBAC/C,OAAO,MAAM,CAAC;YAClB,CAAC;QACL,CAAC;QAAC,MAAM,CAAC;YACL,mEAAmE;QACvE,CAAC;gBAAS,CAAC;YACP,IAAI,CAAC;gBACD,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;oBACjB,MAAM,CAAC,KAAK,EAAE,CAAC;gBACnB,CAAC;YACL,CAAC;YAAC,MAAM,CAAC;gBACL,mEAAmE;YACvE,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC,CAAC;AAUE,gDAAkB;AARtB,MAAM,MAAM,GAAG,IAAI,eAAM,EAAE,CAAC;AAWxB,wBAAM;AAGV,YAAY;AACZ,6BAAwG;AAA/F,6FAAA,MAAM,OAAA;AAAE,+FAAA,QAAQ,OAAA;AAAgB,oGAAA,aAAa,OAAA;AAAE,sGAAA,eAAe,OAAA;AAAE,sGAAA,eAAe,OAAA;AACxF,mDAAiC;AACjC,oDAAkC;AAClC,iDAA+B;AAC/B,kDAAgC;AAEhC,eAAe;AACf,2CAAyB;AACzB,yDAAuC"}