Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

obj-multiplex-es5

1.0.2 • Public • Published

obj-multiplex

simple stream multiplexing for objectMode

usage

// create multiplexer
const mux = new ObjMultiplex()
 
// setup substreams
const streamA = mux.createStream('hello')
const streamB = mux.createStream('world')
 
// pipe over transport (and back)
mux.pipe(transport).pipe(mux)
 
// send values over the substreams
streamA.write({ thisIsAn: 'object' })
streamA.write(123)
 
// or pipe together normally
streamB.pipe(evilAiBrain).pipe(streamB)

Keywords

none

install

npm i obj-multiplex-es5

Downloadsweekly downloads

3

version

1.0.2

license

ISC

last publish

collaborators

  • avatar