JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 167640
  • Score
    100M100P100Q158359F
  • License

Pipe an Array through Node.js streams

Package Exports

  • stream-array

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (stream-array) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

stream-array

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

npm version build status dependencies devDependencies

Usage

var streamify = require('stream-array'),
    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.

var streamify = require('stream-array');

The Array passed into stream-array() can contain any type, as it assumes the receiving stream can handle it. Each element will be dequeued and pushed into the following piped stream.

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

This Stream will emit each element of the source array as chunks.

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

Install

npm install stream-array

License

MIT License