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.0.0 to 1.0.1

7

index.js

@@ -24,3 +24,3 @@ /* jshint node: true */

debug( 'adding collect method' );
debug( 'adding collect method', this._readableState.objectMode, this._readableState.encoding );

@@ -89,3 +89,6 @@ var collected;

stream
.pipe( new PassThrough( { encoding: encoding } ) )
.pipe( new PassThrough( {
encoding: encoding,
objectMode: stream._readableState.objectMode
} ) )
.on( 'collect', function(data) {

@@ -92,0 +95,0 @@ defer.resolve(data);

{
"name": "stream-collect",
"version": "1.0.0",
"version": "1.0.1",
"description": "Collects the output of a stream",

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

# Stream collect
[![npm version](https://badge.fury.io/js/stream-collect.svg)](http://badge.fury.io/js/stream-collect)
Collects a readable streams data as a string buffer or, for object streams, an array.

@@ -4,0 +6,0 @@

@@ -167,2 +167,20 @@ /* jshint node: true, mocha: true */

it( 'collects object data', function() {
var stream = new PassThrough( {objectMode: true});
var ret = collect(stream);
stream.write(1);
stream.write(2);
stream.end(3);
return ret
.then( function(data) {
expect( Array.isArray(data) ).toBe(true);
expect( data ).toEqual( [1,2,3] );
} );
} );
} );
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