Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

serialport

Package Overview
Dependencies
Maintainers
1
Versions
175
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serialport - npm Package Compare versions

Comparing version 1.4.2 to 1.4.5

build/action_after_build.target.mk

12

package.json
{
"name": "serialport",
"version": "1.4.2",
"version": "1.4.5",
"description": "Welcome your robotic javascript overlords. Better yet, program them!",

@@ -46,7 +46,7 @@ "author": {

"node-pre-gyp": "0.5.x",
"bindings": "1.1.1",
"async": "0.1.18",
"sf": "0.1.6",
"optimist": "~0.3.4",
"nan": "~0.7.0"
"bindings": "1.2.1",
"async": "0.9.0",
"sf": "0.1.7",
"optimist": "~0.6.1",
"nan": "~1.3.0"
},

@@ -53,0 +53,0 @@ "bundledDependencies":["node-pre-gyp"],

@@ -10,2 +10,3 @@ /*jslint node: true */

},
//encoding: ascii utf8 utf16le ucs2 base64 binary hex

@@ -28,3 +29,16 @@ //More: http://nodejs.org/api/buffer.html#buffer_buffer

};
},
// Emit a data event every `length` bytes
byteLength: function(length) {
var data = new Buffer(0);
return function(emitter, buffer){
data = Buffer.concat([data, buffer]);
while (data.length >= length) {
var out = data.slice(0,length);
data = data.slice(length);
emitter.emit('data', out);
}
};
}
};

@@ -20,3 +20,3 @@ ```

Version: 1.4.2 - Released July 7, 2014
Version: 1.4.5 - Released August 3, 2014

@@ -54,8 +54,27 @@ *****

**Special Notes**
* Support for Node.js version 0.8.x has been removed. Version 1.4.0 is the last version that supported node.js version 0.8.x.
* Currently support for Node.js version 0.11.x is dealing with an issue in the latest version of v. 0.11.13. We have confirmed things are fine with 0.11.10 and earlier, but not 0.11.11+.
Good luck.
To Install
----------
For most "standard" use cases (node v0.10.x on mac, linux, windows on a x86 or x64 processor), node-serialport will install nice and easy with a simple
```
npm install serialport
```
We are using [node-pre-gyp](https://github.com/mapbox/node-pre-gyp) to compile and post binaries of the library for most common use cases (linux, mac, windows on standard processor platforms). If you are on a special case, node-serialport will work, but it will compile the binary when you install. Follow the instructions below for how that works.
### Installation Special Cases
This assumes you have everything on your system necessary to compile ANY native module for Node.js. This may not be the case, though, so please ensure the following are true for your system before filing an issue about "Does not install". For all operatings systems, please ensure you have Python 2.x installed AND not 3.0, node-gyp (what we use to compile) requires Python 2.x.
### Windows:
#### Windows:

@@ -69,7 +88,7 @@ * Windows 7 or Windows 8.1 are supported.

### Mac OS X:
#### Mac OS X:
Ensure that you have at a minimum the xCode Command Line Tools installed appropriate for your system configuration. If you recently upgraded the OS, it probably removed your installation of Command Line Tools, please verify before submitting a ticket.
### Desktop (Debian/Ubuntu) Linux:
#### Desktop (Debian/Ubuntu) Linux:

@@ -92,3 +111,3 @@ You know what you need for you system, basically your appropriate analog of build-essential. Keep rocking! Ubuntu renamed the `node` binary `nodejs` which can cause problems building `node-serialport`. The fix is simple, install the [nodejs-legacy package](https://packages.debian.org/sid/nodejs-legacy) that symlinks `/usr/bin/nodejs => /usr/bin/node` or install the more up to date nodejs package from [Chris Lea's PPA](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#ubuntu-mint-elementary-os).

### Raspberry Pi Linux:
#### Raspberry Pi Linux:

@@ -95,0 +114,0 @@ * Starting with a a vanilla New Out of the Box Software (NOOBS) Raspbian image (currently tested: 5/25/2013)

@@ -12,3 +12,4 @@ /*jslint node: true */

var path = require('path');
var binding_path = binary.find(path.resolve(path.join(__dirname,'./package.json')));
var PACKAGE_JSON = path.join(__dirname,'package.json');
var binding_path = binary.find(path.resolve(PACKAGE_JSON));
var SerialPortBinding = require(binding_path);

@@ -163,6 +164,2 @@

this.reading = false;
if (options.encoding) {
this.setEncoding(this.encoding);
}
}

@@ -172,3 +169,2 @@

this.path = path;
if (openImmediately) {

@@ -274,3 +270,3 @@ process.nextTick(function () {

}
} else if (err.code && (err.code === 'ENXIO' || (err.errno===-1 || err.code === 'UNKNOWN'))) { // handle edge case were mac/unix doesn't clearly know the error.
} else if (err.code && (err.code === "EBADF" || err.code === 'ENXIO' || (err.errno===-1 || err.code === 'UNKNOWN'))) { // handle edge case were mac/unix doesn't clearly know the error.
self.disconnected();

@@ -369,3 +365,4 @@ } else {

// clean up all other items
var fd = self.fd;
fd = self.fd;
try {

@@ -390,3 +387,3 @@ factory.SerialPortBinding.close(fd, function (err) {

}
}
};

@@ -393,0 +390,0 @@

"use strict";
var chai = require('chai');
var expect = chai.expect;
var sinonChai = require("sinon-chai");
var sinon = require("sinon");
chai.use(sinonChai);

@@ -13,6 +15,6 @@ var parsers = require('../parsers');

it("emits data exactly as it's written", function () {
var mockEmitter = { emit: sinon.spy() };
var data = new Buffer("BOGUS");
parsers.raw(mockEmitter, data);
mockEmitter.emit.calledWith("data", data);
var spy = sinon.spy();
parsers.raw({ emit: spy }, data);
expect(spy.getCall(0).args[1]).to.deep.equal(new Buffer("BOGUS"));
});

@@ -23,11 +25,25 @@ });

it("emits data events split on a delimiter", function () {
var data = new Buffer("I love robots\rEach and Every One\r");
var spy = sinon.spy();
var parser = parsers.readline();
var data = new Buffer("I love robots\rEach and Every One\r");
var mockEmitter = { emit: sinon.spy() };
parser(mockEmitter, data);
mockEmitter.emit.calledWith("data", "I love robots");
mockEmitter.emit.calledWith("data", "Each and Every One");
parser({ emit: spy }, data);
expect(spy).to.have.been.calledWith("data", "I love robots");
expect(spy).to.have.been.calledWith("data", "Each and Every One");
});
});
describe('#byteLength', function(){
it("emits data events every 8 bytes", function () {
var data = new Buffer("Robots are so freaking cool!");
var spy = sinon.spy();
var parser = parsers.byteLength(8);
parser({ emit: spy }, data);
expect(spy.callCount).to.equal(3);
expect(spy.getCall(0).args[1].length).to.equal(8);
expect(spy.getCall(0).args[1]).to.deep.equal(new Buffer("Robots a"));
expect(spy.getCall(1).args[1]).to.deep.equal(new Buffer("re so fr"));
expect(spy.getCall(2).args[1]).to.deep.equal(new Buffer("eaking c"));
});
});
});

@@ -18,12 +18,19 @@ "use strict";

describe('Initialization', function () {
it("Throws an error in callback when trying to open an invalid port", function (done) {
var SerialPort = require('../').SerialPort;
var port = new SerialPort('/dev/nullbad', function (err) {
chai.assert.isDefined(err, "didn't get an error");
if (process.version.indexOf("v0.11.") ===0) {
it("does not currently work due to an issue with node unstable release, works in master.", function (done) {
done();
});
});
} else {
it("Throws an error in callback when trying to open an invalid port", function (done) {
var SerialPort = require('../').SerialPort;
var port = new SerialPort('/dev/nullbad', function (err) {
chai.assert.isDefined(err, "didn't get an error");
done();
});
});
}
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc