Socket
Book a DemoInstallSign in
Socket

pull-merge

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pull-merge

merge a pull stream

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

pull-merge

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

example

var pull = require('pull-stream')
var merge = require('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

FAQs

Package last updated on 29 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts