adb-devices-emitter
TypeScript icon, indicating that this package has built-in type declarations

0.1.9 • Public • Published

adb-devices-emitter

tested with jest code style: prettier

Track insertion device status

Examples

add event listener deviceAdded deviceRemoved

const devicesEmitter = require('adb-devices-emitter')
 
devicesEmitter.on('deviceAdded', ({ sn }) => {
  console.log('deviceAdded sn:', sn)
})
 
devicesEmitter.on('deviceRemoved', ({ sn }) => {
  console.log('deviceRemoved sn:', sn)
})
 
devicesEmitter.start()

stop

const devicesEmitter = require('adb-devices-emitter')
 
devicesEmitter.on('deviceAdded', ({ sn }) => {
  console.log('deviceAdded sn:', sn)
})
 
devicesEmitter.on('deviceRemoved', ({ sn }) => {
  console.log('deviceRemoved sn:', sn)
})
 
devicesEmitter.start()
 
setTimeout(() => {
  console.log('stop')
  devicesEmitter.stop()
}, 100000)

Readme

Keywords

none

Package Sidebar

Install

npm i adb-devices-emitter

Weekly Downloads

897

Version

0.1.9

License

MIT

Unpacked Size

6.79 kB

Total Files

5

Last publish

Collaborators

  • lewiscutey
  • susanpan