obj-multiplex

1.0.0 • 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)

Readme

Keywords

none

Package Sidebar

Install

npm i obj-multiplex

Weekly Downloads

84,750

Version

1.0.0

License

ISC

Last publish

Collaborators

  • kumavis