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

stream-collect

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-collect - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

12

index.js

@@ -109,5 +109,15 @@ /* jshint node: true */

function PassThrough(options) {
if ( !(this instanceof PassThrough ) ) {
return new PassThrough(options);
}
stream.PassThrough.call( this, options );
addToStream(this);
this._resolved = null;
this.on( 'pipe', function(source) {
source.on( 'error', this.emit.bind( this, 'error' ) );
}.bind(this) );
}

@@ -136,2 +146,2 @@

collect.addToStream = addToStream;
collect.PassThrough = PassThrough;
collect.PassThrough = collect.stream = PassThrough;

2

package.json
{
"name": "stream-collect",
"version": "1.1.0",
"version": "1.2.0",
"description": "Collects the output of a stream as callback or promise",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -52,2 +52,4 @@ # Stream collect

When piped, any errors from the source stream will be passed to this stream.
```js

@@ -54,0 +56,0 @@

@@ -17,2 +17,18 @@ /* jshint node: true, mocha: true */

it( 'creates a collect.PassThrough instance', function( ) {
expect( new collect.PassThrough() ).toBeA( collect.PassThrough );
} );
it( 'is a PassThrough stream', function( ) {
expect( new collect.PassThrough() ).toBeA( PassThrough );
} );
it( 'is can be instigated without new', function( ) {
expect( collect.PassThrough() ).toBeA( PassThrough );
} );
it( 'collect.stream is a collect.PassThrough', function( ) {
expect( collect.stream ).toBe( collect.PassThrough );
} );
it( 'collects buffer data', function(done) {

@@ -201,19 +217,24 @@ var stream = new collect.PassThrough()

it( 'passes errors from a piped stream', function() {
var stream = new PassThrough();
var error = new Error('foo');
/*it( 'subsequent calls to then return the same data', function() {
stream.write('foobar');
var stream = new collect.PassThrough();
stream.write(testDataPart1);
stream.end(testDataPart2);
return stream.then( function(data) {
return stream.then();
var promise = stream
.pipe( new collect.PassThrough() )
.then( function(data) {
throw new Error( 'Should not have been called' );
} )
.catch( function(e) {
expect(e).toBe(error);
} );
stream.emit('error',error);
return promise;
} );*/
} );
} );

@@ -220,0 +241,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