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
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 =var createStream =// create a duplex stream that pipes to `spawn-me` on my-server.comvar stream =// create a duplex stream over httpsvar stream =// create a duplex stream that pipes to `spawn-me` spawned in /tmpvar stream =
API
createStream = transports(options)
Create a new transports instance. Options include
command: 'a-command-to-spawn'protocols:// add any custom protocols here{return}// or set http: false to disable a build in protocolhttp: 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