# transport-stream

> Turn a protocol string into a transport duplex stream.

Latest version **1.4.7** (published 2015-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install transport-stream
pnpm add transport-stream
yarn add transport-stream
bun add transport-stream
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.7 |
| Published | 2015-11-19 |
| First published | 2015-04-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 19 |
| Author | Mathias Buus |
| Maintainers | karissa, mafintosh, maxogden |

## Links

- npm: https://www.npmjs.com/package/transport-stream
- Repository: https://github.com/mafintosh/transport-stream
- Issues: https://github.com/mafintosh/transport-stream/issues
- npm.io page: https://npm.io/package/transport-stream

## Dependencies (7)

- [debug](https://npm.io/package/debug.md) ^2.2.0
- [pumpify](https://npm.io/package/pumpify.md) ^1.3.3
- [duplexify](https://npm.io/package/duplexify.md) ^3.4.2
- [debug-stream](https://npm.io/package/debug-stream.md) ^3.0.0
- [fs-transport-stream](https://npm.io/package/fs-transport-stream.md) ^1.1.0
- [ssh-transport-stream](https://npm.io/package/ssh-transport-stream.md) ^1.0.0
- [http-transport-stream](https://npm.io/package/http-transport-stream.md) ^1.1.0

## Recent versions

- 1.4.7 (latest) — 2015-11-19
- 1.4.6 — 2015-11-19
- 1.4.5 — 2015-11-19
- 1.4.4 — 2015-08-20
- 1.4.3 — 2015-08-20
- 1.4.2 — 2015-07-24
- 1.4.1 — 2015-07-24
- 1.4.0 — 2015-07-24
- 1.3.2 — 2015-07-05
- 1.3.1 — 2015-06-19
- 1.3.0 — 2015-06-09
- 1.2.2 — 2015-06-09
- 1.2.1 — 2015-06-07
- 1.2.0 — 2015-06-07
- 1.1.0 — 2015-04-14
- … 2 more at https://npm.io/package/transport-stream/versions

## README

# 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](http://img.shields.io/travis/mafintosh/transport-stream.svg?style=flat)](http://travis-ci.org/mafintosh/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

``` js
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

``` js
{
  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

---
_Source: https://npm.io/package/transport-stream · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
