Closed samhuang1111 closed 4 years ago
Yes, it follows the WebUSB spec which outlines onconnect
and ondisconnect` events:
https://github.com/thegecko/webusb/blob/183e468bb5b9f6e899636c434d7aee689c8511fe/examples/url.js#L45
However, if you just want to detect usb devices in node and don't need it to look like WebUSB, I'd recommend using the node-usb or usb-detection libraries.
Can this api be used to detect USB plug/unplug?