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

ordered-read-streams

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ordered-read-streams - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

15

index.js

@@ -21,4 +21,3 @@ var Readable = require('stream').Readable;

} else {
// initial index in list of streams
this._currentIndex = 0;
// stream data buffer
this._buff = {};

@@ -37,4 +36,4 @@ this._totalStreams = streams.length;

s.on('data', function (data) {
if (i === self._currentIndex) {
// data got from stream, which is at current index
if (i === 0) {
// from first stream we simply push data
self.push(data);

@@ -46,7 +45,4 @@ } else {

s.on('end', function () {
if (i === self._currentIndex) {
// stream ended and it at current index
self._currentIndex++;
}
if (!--self._openedStreams) {
// no more opened streams
// flush buffered data (if any) before end

@@ -62,5 +58,2 @@ for (var j = 0; j < self._totalStreams; j++) {

s.on('error', function (e) {
if (i === self._currentIndex) {
self._currentIndex++;
}
self.emit('error', e);

@@ -67,0 +60,0 @@ });

{
"name": "ordered-read-streams",
"version": "0.0.6",
"version": "0.0.7",
"description": "Combines array of streams into one read stream in strict order",
"main": "index.js",
"scripts": {
"test": "mocha -R spec && jshint *.js test/*.js"
"test": "jshint *.js test/*.js && mocha -R spec"
},

@@ -9,0 +9,0 @@ "repository": {

@@ -113,3 +113,3 @@ var should = require('should');

streams.on('end', function () {
results.length.should.equal(3);
results.length.should.be.exactly(3);
results[0].should.equal('stream 1');

@@ -116,0 +116,0 @@ results[1].should.equal('stream 2');

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