# @jacobbubu/pull-merge

> [![Build Status](https://github.com/jacobbubu/pull-merge/workflows/Build%20and%20Release/badge.svg)](https://github.com/jacobbubu/pull-merge/actions?query=workflow%3A%22Build+and+Release%22) [![Coverage Status](https://coveralls.io/repos/github/jacobbubu/

Latest version **1.0.2** (published 2020-08-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jacobbubu/pull-merge
pnpm add @jacobbubu/pull-merge
yarn add @jacobbubu/pull-merge
bun add @jacobbubu/pull-merge
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2020-08-23 |
| First published | 2020-08-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10.0.0 |
| Dependencies | 0 |
| Unpacked size | 14.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | jacobbubu |
| Maintainers | jacobbubu |

## Links

- npm: https://www.npmjs.com/package/@jacobbubu/pull-merge
- Repository: https://github.com/jacobbubu/pull-merge
- Homepage: https://github.com/jacobbubu/pull-merge#readme
- Issues: https://github.com/jacobbubu/pull-merge/issues
- npm.io page: https://npm.io/package/@jacobbubu/pull-merge

## Recent versions

- 1.0.2 (latest) — 2020-08-23
- 1.0.1 — 2020-08-22
- 1.0.0 — 2020-08-22

## README

# @jacobbubu/pull-merge

[![Build Status](https://github.com/jacobbubu/pull-merge/workflows/Build%20and%20Release/badge.svg)](https://github.com/jacobbubu/pull-merge/actions?query=workflow%3A%22Build+and+Release%22)
[![Coverage Status](https://coveralls.io/repos/github/jacobbubu/pull-merge/badge.svg)](https://coveralls.io/github/jacobbubu/pull-merge)
[![npm](https://img.shields.io/npm/v/@jacobbubu/pull-merge.svg)](https://www.npmjs.com/package/@jacobbubu/pull-merge/)

> Rewriting the [pull-merge](https://github.com/dominictarr/pull-merge) with TypeScript.

# pull-merge

merge sorted pull-streams into one pull stream, while maintaining back-pressure.
Source pull streams MUST be in order.

## why rewriting?

* Familiarity with the original author's intent
* Strong type declarations for colleagues to understand and migrate to other programming languages

## example

``` ts
import * as pull from 'pull-stream'
import merge from '@jacobbubu/pull-merge'

pull(
  merge(pull.values([1, 5, 6]), pull.values([2, 4, 7])),
  pull.collect(function (err, ary) {
    if(err) throw err

    console.log(ary)
    //=> [1, 2, 4, 5, 6, 7]
  })
)

```

## signatures

### merge(left, right, compare?)

return a stream that is the merge of left and right streams.
merge pulls a chunk from both `left` and `right` and then
compares them. `compare` has the same signature as `Array#sort(compare)`.

If the two chunks are compared the same, the chunk from the right stream
is taken, but the left chunk is dropped.

Otherwise, the lowest chunk is passed to the stream.

### merge([streams...], compare?)

Merge a collection of steams. This calls the first signature recursively.


## License

MIT

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