usb-panic-button
v0.1.2
Published
A simple module for interfacing with USB Panic Button hardware.
Downloads
10
Readme
panic-button
A node.js module for interfacing with the cool-looking USB Panic Button hardware like this one.
Dependencies
This module needs usb module (which depends on libusb) in order to access the button hardware. On macOS, you can install libusb using homebrew by running:
brew install libusb
Getting Started
Initialize a new PanicButton object and attach listeners to its "pressed" event. A simple example is shown below:
const PanicButton = require('usb-panic-button');
const panicButton = new PanicButton();
panicButton.on('pressed', () => {
console.log('button pressed!');
});