aero-win-usb-detection
v1.0.3
Published
Listen to USB devices for attach/detach and get drive path and label (Windows only)
Downloads
3
Readme
aero-win-usb-detection
aero-win-usb-detection
allows you to listen for attach/detach events of USB devices and get device path and label.
Install
npm i aero-win-usb-detection
Usage
import UsbEventsContorller from "aero-win-usb-detection";
var usbController = new UsbEventsContorller();
usbController.startListening();
usbController.on("attach", (device) => {
console.log(device);
});
usbController.on("detach", (device) => {
console.log(device);
});
// To stop listening
// usbController.stopListening();