Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 40 lines (26 sloc) 0.878 kb

convoy-stream

A meta-stream for sending multiple streams down a single stream. Like mux-demux except in series instead of in parallel.

convoy-stream is useful in different cases to mux-demux for example, replicating multiple files down a stream, or packing multiple files into one file.

convoy-stream uses length packed frames, so binary data is also supported!

A Simple Example

var convoy = require('..')
var assert = require('assert')
var es     = require('event-stream')

var c = convoy()
var d = convoy()

var c1 = c.createStream() //push a stream onto the stack.

c1.write('hello')
c1.end()

//pipe the convoys together.
c.pipe(d)

var d1 = d.createStream()
d1.on('data', console.log.bind(console))

License

MIT

Something went wrong with that request. Please try again.