New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

pull-join

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pull-join

sql like join with pull-streams

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
5
66.67%
Maintainers
1
Weekly downloads
 
Created
Source

pull-join

perform an SQL-like join on two pull streams.

example

Each stream must have items of form {key: key, value: value} Both streams are loaded into memory until the first one finishes.

var join = require('pull-join')

pull(
  join(
    pull.values([
      {key: 'a', value: 1},
      {key: 'b', value: 2},
      {key: 'c', value: 3},
      {key: 'd', value: 4}
    ]),
    pull.values([
      {key: 'a', value: 10},
      {key: 'b', value: 20},
      {key: 'c', value: 30},
      {key: 'd', value: 40}
    ])
    //optional third argument
    //, map(key, left, right)
  ),
  pull.collect(function (err, ary) {

    console.log(ary)
    //[{key: 'a', left: 1, right: 10}
    //...

  })
)

pull(left, right, map(key, leftV, rightV)?)

Join the values from two streams. Each item in the left and right pull streams must be of the form {key, value}. the right stream will be buffered entirely, and then the keys coming in on the right stream will be matched to it. If you know which stream will less data, make that the left one.

map is a function that returns a single value. this will be the output of the stream. by default, map will return an object like {key, left, right}

License

MIT

FAQs

Package last updated on 24 Sep 2014

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