Socket
Book a DemoInstallSign in
Socket

transport-stream

Package Overview
Dependencies
Maintainers
3
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

transport-stream

Turn a protocol string into a transport duplex stream.

latest
Source
npmnpm
Version
1.4.7
Version published
Maintainers
3
Created
Source

transport-stream

Maintenance note This module isn't actively used in any of our projects anymore, so the amount of new features here will most likely be very low. However, we will fix any bugs and help co-maintain this with anyone interested.

Turn a protocol string into a transport duplex stream.

npm install transport-stream

build status

Ships with support for transports that pipes to remote commands over ssh, piping to the processes spawned on local machine in other folder, http and https.

Usage

var transports = require('transport-stream')
var createStream = transports({
  command: 'cat -' // spawn this command when using ssh or the local file system
})

// create a duplex stream that pipes to `spawn-me` on my-server.com
var stream = createStream('ssh://mafintosh@my-server.com:this-cwd')

// create a duplex stream over https
var stream = createStream('https://server.com/test')

// create a duplex stream that pipes to `spawn-me` spawned in /tmp
var stream = createStream('/tmp')

API

createStream = transports(options)

Create a new transports instance. Options include

{
  command: 'a-command-to-spawn',
  protocols: {
    // add any custom protocols here
    dat: function (url, options) {
      return aDatProtocolStream(url)
    },
    // or set http: false to disable a build in protocol
    http: false
  }
}

If you set the command option file and ssh protocols are enabled per default in addition to http and https.

var stream = createStream(url)

Create a new duplex transport stream based on the protocol used in url. If no suitable protocol is found an exception is thrown.

License

MIT

FAQs

Package last updated on 19 Nov 2015

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