stream-array
Advanced tools
Comparing version 0.1.0 to 0.1.1
14
index.js
@@ -1,2 +0,4 @@ | ||
var Readable = require('stream').Readable; | ||
var Readable = require('stream').Readable | ||
, Queue = require('fastqueue') | ||
; | ||
@@ -15,3 +17,5 @@ if (!Readable) { | ||
this._list = list; | ||
this._queue = new Queue(); | ||
this._queue.tail = list; | ||
this._queue.length = list.length; | ||
} | ||
@@ -22,7 +26,3 @@ | ||
StreamArray.prototype._read = function(size) { | ||
if (0 < this._list.length) { | ||
this.push(this._list.shift()); | ||
} else { | ||
this.push(null); | ||
} | ||
this.push(this._queue.shift()); | ||
}; | ||
@@ -29,0 +29,0 @@ |
{ | ||
"name": "stream-array", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Pipe an Array through Node.js streams", | ||
"dependencies": { | ||
"readable-stream": ">= 1.0.0" | ||
"readable-stream": "~1.0.0", | ||
"fastqueue": "~0.1.0" | ||
}, | ||
"devDependencies": { | ||
"tap": ">= 0.4.0", | ||
"concat-stream": ">= 0.1.1" | ||
"tap": "~0.4.0", | ||
"concat-stream": "~1.0.0" | ||
}, | ||
@@ -12,0 +13,0 @@ "scripts": { |
@@ -6,4 +6,5 @@ # stream-array | ||
[![build status][1]][2] | ||
[![build status][1]][2] [![npm version][3]][4] [![dependencies][5]][6] | ||
## Usage | ||
@@ -18,2 +19,10 @@ | ||
## API | ||
#### streamify(Array) | ||
Provide an Array to streamify which will be iterated over. Each element will | ||
dequeued and pushed into the following piped stream. | ||
## Install | ||
@@ -27,1 +36,6 @@ | ||
[2]: https://travis-ci.org/mimetnet/node-stream-array | ||
[3]: https://badge.fury.io/js/stream-array.png | ||
[4]: https://badge.fury.io/js/stream-array | ||
[5]: https://david-dm.org/mimetnet/node-stream-array.png | ||
[6]: https://david-dm.org/mimetnet/node-stream-array | ||
@@ -10,4 +10,4 @@ var tap = require('tap') | ||
s.pipe(concat(function(err, res) { | ||
t.notOk(err, 'No error'); | ||
s.pipe(concat(function(res) { | ||
t.equal(1, arguments.length, 'concat returns 1 arg'); | ||
t.equal('123Four', res.toString(), 'result matches expectation'); | ||
@@ -21,4 +21,4 @@ t.end(); | ||
s.pipe(concat(function(err, res) { | ||
t.notOk(err, 'No error'); | ||
s.pipe(concat(function(res) { | ||
t.equal(1, arguments.length, 'concat returns 1 arg'); | ||
t.equal('OneTwo', res.toString(), 'result matches expectation'); | ||
@@ -25,0 +25,0 @@ t.end(); |
Sorry, the diff of this file is not supported yet
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
5842
9
92
39
2
+ Addedfastqueue@~0.1.0
+ Addedcore-util-is@1.0.3(transitive)
+ Addedfastqueue@0.1.0(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@0.0.1(transitive)
+ Addedreadable-stream@1.0.34(transitive)
+ Addedstring_decoder@0.10.31(transitive)
- Removedabort-controller@3.0.0(transitive)
- Removedbase64-js@1.5.1(transitive)
- Removedbuffer@6.0.3(transitive)
- Removedevent-target-shim@5.0.1(transitive)
- Removedevents@3.3.0(transitive)
- Removedieee754@1.2.1(transitive)
- Removedprocess@0.11.10(transitive)
- Removedreadable-stream@4.5.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedstring_decoder@1.3.0(transitive)
Updatedreadable-stream@~1.0.0