Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/seymar/serial-device

A node module build on top of serialport adding some handy features
https://github.com/seymar/serial-device

Last synced: 18 days ago
JSON representation

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

Awesome Lists containing this project

README

        

# serial-device

A node module build on top of [serialport](http://npmjs.org/package/serialport) adding some handy features like:
* Auto re-open when a device is plugged in
* Event firing when a new line is received

## Example
```javascript
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`