@herbhq/object-multiplex
v0.1.0
Published
Simple stream multiplexing for `objectMode`.
Readme
@rabby-wallet/object-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);Contributing
Setup
- Install Node.js version 18
- If you are using nvm (recommended) running
nvm usewill automatically choose the right node version for you.
- If you are using nvm (recommended) running
- Install Yarn v1
- Run
yarn setupto install dependencies and run any requried post-install scripts- Warning: Do not use the
yarn/yarn installcommand directly. Useyarn setupinstead. The normal install command will skip required post-install scripts, leaving your development environment in an invalid state.
- Warning: Do not use the
Testing and Linting
Run yarn test to run the tests once.
Run yarn lint to run the linter, or run yarn lint:fix to run the linter and fix any automatically fixable issues.
