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

multi-duplex-stream

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multi-duplex-stream

Duplex stream that reads/writes from/to multiple duplex streams at once

latest
npmnpm
Version
0.1.1
Version published
Weekly downloads
103
18.39%
Maintainers
1
Weekly downloads
 
Created
Source

multi-duplex-stream

Duplex stream that reads/writes from/to multiple duplex streams at once

Installation

npm install multi-duplex-stream

Example

Below is a minimal example of running ssh commands in parallel:

'use strict'

var ssh = require('ssh-exec')
var eos = require('end-of-stream')
var multiDuplex = require('multi-duplex-stream')

module.exports = function pssh (hosts, cmd, cb) {
  var sshStreams = hosts.map(function (host) {
    var stream = ssh(cmd, host)

    return stream
  })

  var psshStream = multiDuplex.obj(sshStreams)

  eos(psshStream, cb)

  return psshStream
}

Documentation

multiDuplex([[streams], options]) / new MultiDuplex([[streams], options])

multiDuplex.obj([[streams], options])

.add(stream)

.remove(stream)

.streams

.destroy([err])

.destroyed

.finalize()

License

MIT

Keywords

multiple

FAQs

Package last updated on 06 Mar 2016

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