first commit

This commit is contained in:
2026-09-08 20:28:54 +08:00
commit 2ada8d3d5a
37380 changed files with 4886169 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
# adb-devices-emitter
[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
Track insertion device status
## Examples
### add event listener `deviceAdded` `deviceRemoved`
```javascript
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
```javascript
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)
```