This simple module was heavily inspired from Jhonny-Five and is used with serialPort for autodetect Arduino board attach via USB.
npm install -S serial-arduino-detect
com = require('serialport');
let board = new Board(com);
board.detect(function(err, port){
if(err) {
console.error('Arduino do not found');
} else {
console.log('see serialPort documentation');
}
});
For search a board you just need to create a new Board with serialPort object, call detect method and passing a callback. This will be fire with err object or a port where Arduino was found.