glue-streams

0.1.0 • Public • Published

glue-streams

NPM version Build Status Dependency Status

Compose one stream from other streams, arrays or individual objects.

Usage

var glue = require('glue-streams');
var stream = require('stream-array');
 
glue.options = {
    objectMode: false,
    highWaterMark: 16
};
 
var glued = glue.obj(
    [1,2,3],
    4,
    stream([5,6,7])
);
glued.pipe(process.stdout);
 
/* Output:
1234567
*/

API

glue(streams...)

Returns stream that will emit objects from passed streams.

streams could be:

  • Readable stream object
  • Ordinary object
  • Array of objects / streams
  • Functions, that will be executed, when all streams before is ended. Returned object will be streamed by previous rules.

glue.obj(streams...)

Creating object stream (overrides glue.options.objectMode to true).

glue.options

Object, that contains options, which will be used for every call to glue(...) or glue.obj(...).

objectMode

Type: Boolean
Default: false

highWaterMark

Type: Number
Default: 16

License

MIT (c) 2014 Vsevolod Strukchinsky

Readme

Keywords

Package Sidebar

Install

npm i glue-streams

Weekly Downloads

1

Version

0.1.0

License

MIT

Last publish

Collaborators

  • floatdrop