arduino-firmata
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -0,1 +1,5 @@ | ||
=== 0.0.2 2014-01-26 | ||
* use SerialPort.list() instead of fs.readdir() | ||
=== 0.0.1 2014-01-26 | ||
@@ -2,0 +6,0 @@ |
(function() { | ||
var ArduinoFirmata, SerialPort, debug, events, fs, | ||
var ArduinoFirmata, SerialPort, debug, events, | ||
__hasProp = {}.hasOwnProperty, | ||
@@ -8,4 +8,2 @@ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; | ||
fs = require('fs'); | ||
SerialPort = require('serialport').SerialPort; | ||
@@ -62,4 +60,4 @@ | ||
ArduinoFirmata.list = function(callback) { | ||
return fs.readdir('/dev', function(err, files) { | ||
var devices, f, _i, _len; | ||
return require('serialport').list(function(err, ports) { | ||
var devices, port, _i, _len; | ||
if (err) { | ||
@@ -69,6 +67,6 @@ callback(err); | ||
devices = []; | ||
for (_i = 0, _len = files.length; _i < _len; _i++) { | ||
f = files[_i]; | ||
if (f.match(/tty\.?(usb|acm)/i)) { | ||
devices.push("/dev/" + f); | ||
for (_i = 0, _len = ports.length; _i < _len; _i++) { | ||
port = ports[_i]; | ||
if (port.comName.match(/usb|acm|com\d+/i)) { | ||
devices.push(port.comName); | ||
} | ||
@@ -75,0 +73,0 @@ } |
{ | ||
"name": "arduino-firmata", | ||
"private": false, | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Arduino Firmata implementation for Node.js", | ||
@@ -6,0 +6,0 @@ "main": "lib/arduino-firmata.js", |
@@ -9,2 +9,3 @@ arduino-firmata | ||
- https://github.com/shokai/node-arduino-firmata | ||
- https://npmjs.org/package/arduino-firmata | ||
@@ -11,0 +12,0 @@ |
Sorry, the diff of this file is not supported yet
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
21897
96
5
275