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

bufferedstream

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bufferedstream - npm Package Compare versions

Comparing version 2.3.1 to 2.4.0

scripts/bundle-specs

34

BufferedStream.js
var d = require('d');
var bops = require('bops');
var Buffer = require('buffer').Buffer;
var ee = require('event-emitter');

@@ -16,5 +16,12 @@ var allOff = require('event-emitter/all-off');

var VALID_ENCODINGS = {
utf8: true,
hex: true,
base64: true
'hex': true,
'utf8': true,
'utf-8': true,
'ascii': true,
'binary': true,
'base64': true,
'ucs2': true,
'ucs-2': true,
'utf16le': true,
'utf-16le': true
};

@@ -100,3 +107,3 @@

if (VALID_ENCODINGS[encoding] !== true)
throw new Error('Invalid encoding: ' + encoding);
throw new Error('Unknown encoding: ' + encoding);

@@ -218,7 +225,7 @@ this.encoding = encoding;

if (!bops.is(chunk))
chunk = bops.from(chunk, arguments[1]);
if (!Buffer.isBuffer(chunk))
chunk = new Buffer(chunk, arguments[1]);
this._chunks.push(chunk);
this.size += getByteLength(chunk);
this.size += chunk.length;

@@ -286,6 +293,6 @@ flushSoon(this);

while (chunk = stream._chunks.shift()) {
stream.size -= getByteLength(chunk);
stream.size -= chunk.length;
if (stream.encoding) {
stream.emit('data', bops.to(chunk, stream.encoding));
stream.emit('data', chunk.toString(stream.encoding));
} else {

@@ -311,9 +318,2 @@ stream.emit('data', chunk);

function getByteLength(chunk) {
if (typeof chunk.byteLength !== 'undefined')
return chunk.byteLength;
return chunk.length;
}
module.exports = BufferedStream;

@@ -0,8 +1,13 @@

= 2.4.0 / 2014-08-05
* Use Browserify's Buffer module instead of bops
* Added browser specs
= 2.3.1 / 2014-08-04
* Fix compat regression with node v2 Readable streams.
* Fix compat regression with node v2 Readable streams
= 2.3.0 / 2014-08-02
* Auto-resume on pipe(). This mimics the behavior of node streams v2.
* Auto-resume on pipe(). This mimics the behavior of node streams v2

@@ -9,0 +14,0 @@ = 2.2.0 / 2014-07-14

@@ -5,3 +5,3 @@ {

"author": "Michael Jackson",
"version": "2.3.1",
"version": "2.4.0",
"repository": {

@@ -13,3 +13,3 @@ "type": "git",

"scripts": {
"test": "mocha spec"
"test": "./scripts/run-specs"
},

@@ -20,3 +20,3 @@ "engines": {

"dependencies": {
"bops": "~0.1.1",
"buffer": "~2.5.0",
"d": "~0.1.1",

@@ -27,3 +27,5 @@ "event-emitter": "~0.3.1",

"devDependencies": {
"browserify": "~4.1.9",
"expect": "~0.1.1",
"http-server": "^0.6.1",
"mocha": "~1.20.1"

@@ -30,0 +32,0 @@ },

@@ -45,8 +45,16 @@ [![build status](https://secure.travis-ci.org/mjackson/bufferedstream.png)](http://travis-ci.org/mjackson/bufferedstream)

Run the specs with [mocha](http://visionmedia.github.com/mocha/):
To run the specs in node:
$ mocha spec
$ npm install
$ ./scripts/run-specs
To run the specs in a browser, first run:
$ npm install
$ ./scripts/serve-specs
Then open [http://localhost:8080/](http://localhost:8080/) in a browser.
### License
[MIT](http://opensource.org/licenses/MIT)
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