# object-merge-stream

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

Latest version **1.1.0** (published 2015-01-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install object-merge-stream
pnpm add object-merge-stream
yarn add object-merge-stream
bun add object-merge-stream
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2015-01-20 |
| First published | 2014-12-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | rangermauve |
| Maintainers | rangermauve |
| Keywords | stream, merge, object, extend, state |

## Links

- npm: https://www.npmjs.com/package/object-merge-stream
- Repository: https://github.com/RangerMauve/object-merge-stream
- Issues: https://github.com/RangerMauve/object-merge-stream/issues
- npm.io page: https://npm.io/package/object-merge-stream

## Dependencies (2)

- [through2](https://npm.io/package/through2.md) ^0.6.3
- [object-merge](https://npm.io/package/object-merge.md) ^2.5.1

## Alternatives

- [@reckona/mreact-store](https://npm.io/package/@reckona/mreact-store.md) — 976 weekly downloads
- [regular-state](https://npm.io/package/regular-state.md) — 410 weekly downloads
- [@pacote/flux-actions](https://npm.io/package/@pacote/flux-actions.md) — 65 weekly downloads
- [@pilotlab/lux-debug](https://npm.io/package/@pilotlab/lux-debug.md) — 39 weekly downloads
- [vue-persist-state](https://npm.io/package/vue-persist-state.md) — 19 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2015-01-20
- 1.0.0 — 2014-12-14

## 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

``` javascript
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' } }
*/
```

---
_Source: https://npm.io/package/object-merge-stream · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
