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.0 to 2.3.1

23

BufferedStream.js

@@ -63,6 +63,6 @@ var d = require('d');

if (typeof source.pipe === 'function') {
if (typeof source.resume === 'function')
source.resume(); // Triggers "old mode" in node v2 streams.
source.pipe(this);
if (typeof source.resume === 'function')
source.resume();
} else {

@@ -158,12 +158,10 @@ this.end(source, sourceEncoding);

// source gets the 'end' or 'close' events. Only dest.end() once.
if (!dest._isStdio && (!options || options.end !== false)) {
if (!dest._isStdio && (!options || options.end !== false))
source.on('end', onend);
}
// don't leave dangling pipes when there are errors.
function onerror(er) {
function onerror(error) {
cleanup();
if (!hasListeners(this, 'error')) {
throw er; // Unhandled stream error in pipe.
}
if (!hasListeners(this, 'error'))
throw error; // Unhandled stream error in pipe.
}

@@ -193,3 +191,3 @@

// Mimic the behavior of node v2 streams where pipe() resumes the flow.
// This also lets us avoid having to do stream.resume() all over the place.
// This lets us avoid having to do stream.resume() all over the place.
source.resume();

@@ -239,5 +237,4 @@

* Writes the given chunk to this stream and queues the end event to be
* called as soon as soon as possible. If the stream is not currently
* scheduled to be flushed, the end event will fire immediately. Otherwise, it
* will fire after the next flush.
* called as soon as soon as the stream is empty. Calling write() after
* end() is an error.
*/

@@ -244,0 +241,0 @@ end: d(function (chunk) {

@@ -0,1 +1,5 @@

= 2.3.1 / 2014-08-04
* Fix compat regression with node v2 Readable streams.
= 2.3.0 / 2014-08-02

@@ -2,0 +6,0 @@

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

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

@@ -8,0 +8,0 @@ "type": "git",

@@ -37,2 +37,6 @@ [![build status](https://secure.travis-ci.org/mjackson/bufferedstream.png)](http://travis-ci.org/mjackson/bufferedstream)

```js
var stream = new BufferedStream(anotherStream);
```
Please see the source code for more information. The module is small enough (and well-documented) that it should be easy to digest in a quick skim.

@@ -39,0 +43,0 @@

@@ -191,2 +191,13 @@ var assert = require('assert');

testSourceType('Buffer', Buffer);
describe('when sourced from a node Readable', function () {
it('does not throw', function () {
var fs = require('fs');
var source = fs.createReadStream(__filename);
expect(function () {
var stream = new BufferedStream(source);
}).toNotThrow();
});
});
});

@@ -193,0 +204,0 @@

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