# combine-evented-stream

> Combine multiple evented streams into one

Latest version **0.1.8** (published 2020-08-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install combine-evented-stream
pnpm add combine-evented-stream
yarn add combine-evented-stream
bun add combine-evented-stream
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.8 |
| Published | 2020-08-26 |
| First published | 2018-12-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >= 8.9.0 |
| Dependencies | 4 |
| Unpacked size | 9.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Hoàng Văn Khải |
| Maintainers | khai96_ |
| Keywords | combine, stream, event, join, async |

## Links

- npm: https://www.npmjs.com/package/combine-evented-stream
- Repository: https://github.com/ksxnodeapps/fun-little-utilities
- Homepage: https://ksxnodeapps.github.io/fun-little-utilities/
- Issues: https://github.com/ksxnodeapps/fun-little-utilities/issues
- npm.io page: https://npm.io/package/combine-evented-stream

## Dependencies (4)

- [tslib](https://npm.io/package/tslib.md) ^2.0.1
- [@types/node](https://npm.io/package/@types/node.md) ^14.6.0
- [event-target-proxy](https://npm.io/package/event-target-proxy.md) ^0.1.8
- [evented-stream-types](https://npm.io/package/evented-stream-types.md) ^0.1.8

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 0.1.8 (latest) — 2020-08-26
- 0.1.7 — 2020-04-04
- 0.1.6 — 2020-02-27
- 0.1.5 — 2020-01-30
- 0.1.4 — 2020-01-12
- 0.1.2 — 2019-10-05
- 0.1.1 — 2019-10-03
- 0.1.0 — 2019-09-18
- 0.0.1 — 2019-08-03
- 0.0.0 — 2018-12-05

## README

# Combine Evented Stream

Combine multiple evented streams into one

## Usage Examples

### Log output of multiple child processes

```javascript
const { spawn } = require('child_process')
const combine = require('combine-evented-stream')

const cps = [
  'foo',
  'bar',
  'baz'
].map(program => spawn(program))

const stream = combine(cps)

stream.addListener('data', ({ stream, chunk }) => {
  console.log({
    pid: stream.pid,
    data: chunk
  })
})

stream.addListener('close', () => {
  console.log('done.')
  return process.exit(0)
})
```

**Utilize [`iterate-evented-stream`](https://npmjs.com/package/iterate-evented-stream):**

Assuming the context of execution below is async.

```javascript
const { spawn } = require('child_process')
const combine = require('combine-evented-stream')
const iterate = require('iterate-evented-stream')

const cps = [
  'foo',
  'bar',
  'baz'
].map(program => spawn(program))

const stream = combine(cps)

for await (const { stream, chunk } of iterate(stream)) {
  console.log({
    pid: stream.pid,
    data: chunk
  })
}

console.log('done.')
```

## License

[MIT](https://git.io/fxKXN) © [Hoàng Văn Khải](https://github.com/KSXGitHub)

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