serial-device

0.0.3 • Public • Published

serial-device

A node module build on top of serialport adding some handy features like:

  • Auto re-open when a device is plugged in
  • Event firing when a new line is received

Example

var SerialDevice = require('serialdevice');
var hub = new SerialDevice({
  comName: '/dev/cu.usbmodem12341',
  serialOptions: { // Options passed to serialport module
    baudrate: 115200
  },
  lineEnding: '\r\n' // Default: \n
});
hub.on('line', function(line) {
	console.log(line);
}
hub.send(new Buffer('data\n'));

Installation

npm install serial-device

Readme

Keywords

Package Sidebar

Install

npm i serial-device

Weekly Downloads

1

Version

0.0.3

License

ISC

Last publish

Collaborators

  • seymar