Simple stream multiplexing for objectMode.
npm install @metamask/object-multiplexSimple stream multiplexing for objectMode.
``js
// 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);
`
- Install Node.js version 18
- If you are using nvm (recommended) running nvm use will automatically choose the right node version for you.yarn setup
- Install Yarn v1
- Run to install dependencies and run any requried post-install scriptsyarn
- Warning: Do not use the / yarn install command directly. Use yarn setup instead. The normal install command will skip required post-install scripts, leaving your development environment in an invalid state.
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.
The project follows the same release process as the other libraries in the MetaMask organization:
1. Create a release branch
- For a typical release, this would be based on main1.x
- To update an older maintained major version, base the release branch on the major version branch (e.g. )yarn version --minor --no-git-tag-version`)
2. Update the changelog
3. Update version in package.json file (e.g.
4. Create a pull request targeting the base branch (e.g. master or 1.x)
5. Code review and QA
6. Once approved, the PR is squashed & merged
7. The commit on the base branch is tagged
8. The tag can be published as needed