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

stream-array

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-array - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

test/0.js

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

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