Skip to content

Instantly share code, notes, and snippets.

@juliangruber
Last active August 29, 2015 14:20
Show Gist options
  • Select an option

  • Save juliangruber/866f388f0b9e2e591462 to your computer and use it in GitHub Desktop.

Select an option

Save juliangruber/866f388f0b9e2e591462 to your computer and use it in GitHub Desktop.
multiplex test
var multiplex = require('multiplex');
var a = multiplex(function(stream, meta){
console.log('a meta', meta)
})
var b = multiplex(function(stream, meta){
console.log('b meta', meta)
})
a.pipe(b).pipe(a)
a.createStream('foo')
a.createStream('foo')
b.createStream('foo')
b.createStream('foo')
∴ mt : node index.js
b meta foo
b meta foo
a meta foo
a meta foo
{
"dependencies": {
"multiplex": "^5.0.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment