stream-array-es6

1.0.1 • Public • Published

stream-array-es6

Pipe an Array through Node.js Streams. This is rather useful for testing other streams.

npm version build status dependencies devDependencies

Usage

const streamify = require('stream-array-es6'),
  os = require('os');
 
streamify(['1', '2', '3', os.EOL]).pipe(process.stdout);

API

streamify(Array)

The result of require is a 'function()' that when invoked, will return a Readable Stream.

const streamify = require('stream-array-es6');

The source array can contain any type as it is assumed that the receiving stream can handle it. Each element in the array will be pushed into the piped stream, without modifying the source array.

const readable = streamify(['Hello', new Buffer('World')]);

This Stream will push each element of the source array into the piped array.

readable(['1', '2', '3', os.EOL]).pipe(process.stdout);
123\n

Install

npm install stream-array-es6

License

MIT License

Package Sidebar

Install

npm i stream-array-es6

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

7.84 kB

Total Files

10

Last publish

Collaborators

  • syumai