ordered-read-streams
Advanced tools
Comparing version 0.1.0 to 0.2.0
33
index.js
@@ -1,2 +0,3 @@ | ||
var Readable = require('stream').Readable; | ||
var Readable = require('readable-stream').Readable; | ||
var isReadable = require('isstream').isReadable; | ||
var util = require('util'); | ||
@@ -7,7 +8,4 @@ | ||
{ | ||
if(!stream.readable) throw new Error('All input streams must be readable'); | ||
if(!isReadable(stream)) throw new Error('All input streams must be readable'); | ||
if(this._readableState.ended) throw new Error('Adding streams after ended'); | ||
var self = this; | ||
@@ -17,4 +15,8 @@ | ||
stream.on('data', function(chunk) | ||
stream.on('readable', function() | ||
{ | ||
var chunk = stream.read(); | ||
if (chunk === null) | ||
return; | ||
if(this === streams[0]) | ||
@@ -44,3 +46,2 @@ self.push(chunk); | ||
streams.push(stream); | ||
@@ -70,16 +71,10 @@ } | ||
this.concat = function() | ||
streams.forEach(function(item) | ||
{ | ||
Array.prototype.forEach.call(arguments, function(item) | ||
{ | ||
if(Array.isArray(item)) | ||
item.forEach(addStream_bind); | ||
if(Array.isArray(item)) | ||
item.forEach(addStream_bind); | ||
else | ||
addStream_bind(item); | ||
}); | ||
}; | ||
this.concat(streams); | ||
else | ||
addStream_bind(item); | ||
}); | ||
} | ||
@@ -86,0 +81,0 @@ util.inherits(OrderedStreams, Readable); |
{ | ||
"name": "ordered-read-streams", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Combines array of streams into one read stream in strict order", | ||
@@ -21,3 +21,7 @@ "main": "index.js", | ||
"pre-commit": "0.0.4" | ||
}, | ||
"dependencies": { | ||
"isstream": "^0.1.1", | ||
"readable-stream": "^1.0.33" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8716
2
196
+ Addedisstream@^0.1.1
+ Addedreadable-stream@^1.0.33
+ Addedcore-util-is@1.0.3(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@0.0.1(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedreadable-stream@1.1.14(transitive)
+ Addedstring_decoder@0.10.31(transitive)