oms

object-merge-stream

Takes in a stream of objects and merges them together, outputting every time the state updates.

Showing:

Popularity

Downloads/wk

1

GitHub Stars

3

Maintenance

Last Commit

7yrs ago

Contributors

2

Package

Dependencies

2

Size (min+gzip)

5.5KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

object-merge-stream

Takes in a stream of objects and merges them together, outputting every time the state updates.

API

mergeStream([state],[options])

Creates a new Transform stream which takes in objects, merges them, and outputs on every merge.

parameters

  • [state] (Object): An optional initial state for merging.
  • [options] (Object): Contains options like depth.

returns

  • (TransformStream): Takes in objects, spits out objects.

Example

var streamArray = require("stream-array");
var stdout = require("stdout");
var mergeStream = require("object-merge-stream");

var data = [{
    foo: "bar"
}, {
    baz: {
        fizz: "buzz"
    }
}, {
    baz: {
        qux: "norf"
    }
}];

streamArray(data)
.pipe(mergeStream())
.pipe(stdout());

/*
{ foo: 'bar' }
{ foo: 'bar', baz: { fizz: 'buzz' } }
{ foo: 'bar', baz: { fizz: 'buzz', qux: 'norf' } }
*/

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100