node-serialport-bindings-cpp/lib/bindings.js
Francis Gulotta dcfe2ab4ee Switch up testing infrastructure (#881)
- npm test now runs everything but stress tests
 - TEST_PORT is optional but now requires an arduino, the travis provided OS X serial port wasn't worth it
 - do some improvements to coverage
 - Drop grunt for file size and complexity
 - Eslint has dropped 0.10

I don't think Istanbul can detect coverage on sandboxed modules like our mocked bindings. Moving to an isolated binding will improve this situation.

I also don't think coveralls is working on travis
2016-07-24 22:20:23 -04:00

27 lines
624 B
JavaScript

'use strict';
var bindings = require('bindings')('serialport.node');
var listLinux = require('./list-linux');
var linux = process.platform !== 'win32' && process.platform !== 'darwin';
var platformOptions = {};
if (process.platform !== 'win32') {
platformOptions = {
vmin: 1,
vtime: 0
};
}
module.exports = {
close: bindings.close,
drain: bindings.drain,
flush: bindings.flush,
list: linux ? listLinux : bindings.list,
open: bindings.open,
SerialportPoller: bindings.SerialportPoller,
set: bindings.set,
update: bindings.update,
write: bindings.write,
platformOptions: platformOptions
};