devices-tracker
v1.0.1
Published
a tool to track devices
Downloads
4
Readme
devices-tracker
Track insertion device status
Examples
add event listener deviceAdded
deviceRemoved
const devicesTracker = require('devices-tracker')
devicesTracker.on('deviceAdded', ({ sn }) => {
console.log('deviceAdded sn:', sn)
})
devicesTracker.on('deviceRemoved', ({ sn }) => {
console.log('deviceRemoved sn:', sn)
})
devicesTracker.start()
stop
const devicesTracker = require('devices-tracker')
devicesTracker.on('deviceAdded', ({ sn }) => {
console.log('deviceAdded sn:', sn)
})
devicesTracker.on('deviceRemoved', ({ sn }) => {
console.log('deviceRemoved sn:', sn)
})
devicesTracker.start()
setTimeout(() => {
console.log('stop')
devicesTracker.stop()
}, 100000)