UNPKG

node-hidspy

Version:

An event based node.js c++ addon/binding to detect the hid device insertion/removal and notify the subscribed apps.

15 lines (12 loc) 276 B
var hidspy = require("../index"); hidspy.spyOn().then(function() { hidspy.on("change", function(data) { console.log(data); }); hidspy.on("end", function() { console.log('Stop to listen'); }); }); setTimeout(() => { hidspy.spyOff(); }, 5000);