1.0.0 • Published 9 years ago

watch-serial v1.0.0

Weekly downloads
30
License
-
Repository
github
Last release
9 years ago

watch-serial

watch for new serial devices. stream with plug/unplg events.

var serialport = require('serialport');
var watch = require('watch-serial'); 

// you must pass the serialport module to watch 
// it's no longer a direct dependency dude to native deps sucking

var stream = watch(serialport);

stream.on('data',console.log)

this will output something like this when a device is plugged then unplugged.

{ event: 'plug',
  device: 
   { comName: '/dev/ttyACM1',
     manufacturer: undefined,
     pnpId: 'usb-Pinoccio_Pinoccio_95335343036351E07191-if00' },
  id: '/dev/ttyACM1|undefined|usb-Pinoccio_Pinoccio_95335343036351E07191-if00' }
{ event: 'unplug',
  device: 
   { comName: '/dev/ttyACM1',
     manufacturer: undefined,
     pnpId: 'usb-Pinoccio_Pinoccio_95335343036351E07191-if00' },
  id: '/dev/ttyACM1|undefined|usb-Pinoccio_Pinoccio_95335343036351E07191-if00' }

changelog

1.0.0

breaking chages from 0.0.X. serialport must be passed into watch. its no longer a dep

1.0.0

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

10 years ago

0.0.1

10 years ago