Closed sandeepmistry closed 5 years ago
Thanks, LGTM.
I'll leave this open until https://github.com/DefinitelyTyped/DefinitelyTyped/pull/32106 is released so the version of the type can be updated.
@types/usb 1.1.8 has been published with your addition. Would you ind updating this PR to use it?
@thegecko sure thing, just pushed a change the package.json
to use "@types/usb": "^1.1.8"
.
Awesome!
Thanks @sandeepmistry I've released a new version on npm.
Depends on https://github.com/DefinitelyTyped/DefinitelyTyped/pull/32106
These changes only add the
usb
"attach"/"detach" handlers if a listener is "connected"/"disconnected".It allows apps that don't listen to these events to exit automatically, as well as exit automatically if listeners for both events are not attached.
node-usb
uses a similar pattern here: https://github.com/tessel/node-usb/blob/master/usb.js#L511-L524