{"_id":"@aptre/yamux","_rev":"5-5613ff212b665af9689fa91fd03effbf","name":"@aptre/yamux","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@aptre/yamux","version":"1.0.0","keywords":["IPFS","libp2p","multiplexer","muxer","stream"],"license":"Apache-2.0 OR MIT","_id":"@aptre/yamux@1.0.0","maintainers":[{"name":"paralin","email":"christian@paral.in"}],"homepage":"https://github.com/aperturerobotics/js-yamux#readme","bugs":{"url":"https://github.com/aperturerobotics/js-yamux/issues"},"dist":{"shasum":"dc7e134024b51b9cd56f343d19c19fe6460fb620","tarball":"https://registry.npmjs.org/@aptre/yamux/-/yamux-1.0.0.tgz","fileCount":54,"integrity":"sha512-+uVxPreHM57Nt93WPKBdQ9XP4CTzZZTyKzl5RVkwK6Fm/AlKATKq59v12tVtKcML8i0n4iO8B7BdkjcWYOw20w==","signatures":[{"sig":"MEUCIQCbehikFW8hMMe2pPN/mhFUIdhua9x6iq2l8kZ+nCAIaAIgd6pVQP6swklkUq9s7phIJh1+SsIKbjOH6ddB+eaarNk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":340427},"type":"module","types":"./dist/src/index.d.ts","exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"},"./config":{"types":"./dist/src/config.d.ts","import":"./dist/src/config.js"},"./stream":{"types":"./dist/src/stream.d.ts","import":"./dist/src/stream.js"}},"scripts":{"lint":"aegir lint","test":"aegir test","build":"aegir build","clean":"aegir clean","release":"bun run release:version && bun run release:commit","benchmark":"benchmark dist/test/bench/*.bench.js --timeout 400000","dep-check":"aegir dep-check","test:node":"aegir test -t node --cov","test:chrome":"aegir test -t browser","test:firefox":"aegir test -t browser -- --browser firefox","release:minor":"bun run release:version:minor && bun run release:commit","release:commit":"git reset && git add package.json && git commit -m \"chore: release v$(node -p \\\"require('./package.json').version\\\")\" && git tag v$(node -p \"require('./package.json').version\")","release:publish":"git push && git push --tags","release:version":"node -e \"const fs=require('fs');const f='package.json';const p=JSON.parse(fs.readFileSync(f,'utf8'));const [a,b,c]=p.version.split('.').map(Number);p.version=[a,b,c+1].join('.');fs.writeFileSync(f, JSON.stringify(p, null, 2)+'\\n')\"","test:electron-main":"aegir test -t electron-main","release:version:minor":"node -e \"const fs=require('fs');const f='package.json';const p=JSON.parse(fs.readFileSync(f,'utf8'));const [a,b]=p.version.split('.').map(Number);p.version=[a,b+1,0].join('.');fs.writeFileSync(f, JSON.stringify(p, null, 2)+'\\n')\"","test:chrome-webworker":"aegir test -t webworker","test:firefox-webworker":"aegir test -t webworker -- --browser firefox"},"_npmUser":{"name":"paralin","email":"christian@paral.in"},"repository":{"url":"git+https://github.com/aperturerobotics/js-yamux.git","type":"git"},"_npmVersion":"11.12.1","description":"Yamux stream multiplexer for libp2p","directories":{},"_nodeVersion":"25.9.0","dependencies":{"it-foreach":"^2.0.6","main-event":"^1.0.1","it-pushable":"^3.2.3","race-signal":"^1.1.3","get-iterator":"^2.0.1","@libp2p/utils":"^6.0.0","uint8arraylist":"^2.4.8","it-stream-types":"^2.0.1"},"publishConfig":{"access":"public","provenance":false},"typesVersions":{"*":{"*":["*","dist/*","dist/src/*","dist/src/*/index"],"src/*":["*","dist/*","dist/src/*","dist/src/*/index"]}},"_hasShrinkwrap":false,"devDependencies":{"aegir":"^47.0.17","it-pair":"^2.0.6","it-pipe":"^3.0.1","it-drain":"^3.0.5","@libp2p/mplex":"^11.0.0","@dapplion/benchmark":"^1.0.0","@libp2p/interface-compliance-tests":"^6.4.12"},"_npmOperationalInternal":{"tmp":"tmp/yamux_1.0.0_1776846357779_0.6929327985163451","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@aptre/yamux","version":"1.0.3","description":"Yamux stream multiplexer for libp2p","license":"Apache-2.0 OR MIT","homepage":"https://github.com/aperturerobotics/js-yamux#readme","repository":{"type":"git","url":"git+https://github.com/aperturerobotics/js-yamux.git"},"bugs":{"url":"https://github.com/aperturerobotics/js-yamux/issues"},"publishConfig":{"access":"public","provenance":true},"keywords":["IPFS","libp2p","multiplexer","muxer","stream"],"type":"module","types":"./dist/src/index.d.ts","typesVersions":{"*":{"*":["*","dist/*","dist/src/*","dist/src/*/index"],"src/*":["*","dist/*","dist/src/*","dist/src/*/index"]}},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"},"./config":{"types":"./dist/src/config.d.ts","import":"./dist/src/config.js"},"./stream":{"types":"./dist/src/stream.d.ts","import":"./dist/src/stream.js"}},"scripts":{"clean":"aegir clean","lint":"aegir lint","dep-check":"aegir dep-check","benchmark":"benchmark dist/test/bench/*.bench.js --timeout 400000","build":"aegir build","test":"aegir test","test:chrome":"aegir test -t browser","test:chrome-webworker":"aegir test -t webworker","test:firefox":"aegir test -t browser -- --browser firefox","test:firefox-webworker":"aegir test -t webworker -- --browser firefox","test:node":"aegir test -t node --cov","test:electron-main":"aegir test -t electron-main","release":"npm run release:version && npm run release:commit","release:minor":"npm run release:version:minor && npm run release:commit","release:version":"npm version patch -m \"release: v%s\" --no-git-tag-version","release:version:minor":"npm version minor -m \"release: v%s\" --no-git-tag-version","release:commit":"git reset && git add package.json && git commit -s -m \"release: v$(node -p \"require('./package.json').version\")\" && git tag v$(node -p \"require('./package.json').version\")","release:publish":"git push && git push --tags"},"dependencies":{"@libp2p/utils":"^6.0.0","get-iterator":"^2.0.1","it-foreach":"^2.0.6","it-pushable":"^3.2.3","it-stream-types":"^2.0.1","main-event":"^1.0.1","race-signal":"^1.1.3","uint8arraylist":"^2.4.8"},"devDependencies":{"@dapplion/benchmark":"^1.0.0","@libp2p/interface-compliance-tests":"^6.4.12","@libp2p/mplex":"^11.0.0","aegir":"^47.0.17","it-drain":"^3.0.5","it-pair":"^2.0.6","it-pipe":"^3.0.1"},"gitHead":"1306cb177ca02737b74f0cfa465958d51733c34d","_id":"@aptre/yamux@1.0.3","_nodeVersion":"25.9.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-SQPOI1BX7kNtz2VudaD7VNIavlyJauXI+5Ygl/jc/EAGFnG4me9R4pEneBWux9Wn33um2urzWZz3DBXLXNPkjQ==","shasum":"48749359b6fa1b80afb35a357de64d0b586b5ffc","tarball":"https://registry.npmjs.org/@aptre/yamux/-/yamux-1.0.3.tgz","fileCount":54,"unpackedSize":340128,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aptre%2fyamux@1.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCuBJOE7IUqZ9PkYGiVCT042nowjISUY10eChrFpsXwOwIgTy3akooFKcOtRmCfgwSS7wwnQdSLO+LxsPshUD/e/vY="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:312fd212-a183-4a2d-ab76-941ddbf02119"}},"directories":{},"maintainers":[{"name":"paralin","email":"christian@paral.in"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/yamux_1.0.3_1776847146350_0.8365009719821355"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-22T08:25:57.593Z","modified":"2026-04-22T08:39:06.758Z","7.0.4":"2026-04-22T08:23:47.241Z","1.0.0":"2026-04-22T08:25:57.919Z","1.0.3":"2026-04-22T08:39:06.492Z"},"bugs":{"url":"https://github.com/aperturerobotics/js-yamux/issues"},"license":"Apache-2.0 OR MIT","homepage":"https://github.com/aperturerobotics/js-yamux#readme","keywords":["IPFS","libp2p","multiplexer","muxer","stream"],"repository":{"type":"git","url":"git+https://github.com/aperturerobotics/js-yamux.git"},"description":"Yamux stream multiplexer for libp2p","maintainers":[{"name":"paralin","email":"christian@paral.in"}],"readme":"# @aptre/yamux\n\n> Yamux stream multiplexer for JavaScript\n\n# About\n\nThis module is a JavaScript implementation of [Yamux from Hashicorp] designed to be used with as few dependencies as possible.\n\nThis is a fork of [ChainSafe's js-libp2p-yamux] with the libp2p dependencies removed for use in standalone applications.\n\n[Yamux from Hashicorp]: https://github.com/hashicorp/yamux/blob/master/spec.md\n[ChainSafe's js-libp2p-yamux]: https://github.com/ChainSafe/js-libp2p-yamux\n\n## Example - Using the low-level API\n\n```js\nimport { yamux } from '@aptre/yamux'\nimport { pipe } from 'it-pipe'\nimport { duplexPair } from 'it-pair/duplex'\nimport all from 'it-all'\n\n// Connect two yamux muxers to demo basic stream multiplexing functionality\n\nconst clientMuxer = yamux({\n  client: true,\n  onIncomingStream: stream => {\n    // echo data on incoming streams\n    pipe(stream, stream)\n  },\n  onStreamEnd: stream => {\n    // do nothing\n  }\n})()\n\nconst serverMuxer = yamux({\n  client: false,\n  onIncomingStream: stream => {\n    // echo data on incoming streams\n    pipe(stream, stream)\n  },\n  onStreamEnd: stream => {\n    // do nothing\n  }\n})()\n\n// `p` is our \"connections\", what we use to connect the two sides\n// In a real application, a connection is usually to a remote computer\nconst p = duplexPair()\n\n// connect the muxers together\npipe(p[0], clientMuxer, p[0])\npipe(p[1], serverMuxer, p[1])\n\n// now either side can open streams\nconst stream0 = clientMuxer.newStream()\nconst stream1 = serverMuxer.newStream()\n\n// Send some data to the other side\nconst encoder = new TextEncoder()\nconst data = [encoder.encode('hello'), encoder.encode('world')]\npipe(data, stream0)\n\n// Receive data back\nconst result = await pipe(stream0, all)\n\n// close a stream\nstream1.close()\n\n// close the muxer\nclientMuxer.close()\n```\n\n# Install\n\n```console\n$ npm i @aptre/yamux\n```\n\nor\n\n```console\n$ yarn add @aptre/yamux\n```\n\n# License\n\nLicensed under either of\n\n- Apache 2.0, ([LICENSE-APACHE](https://github.com/aperturerobotics/js-yamux/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)\n- MIT ([LICENSE-MIT](https://github.com/aperturerobotics/js-yamux/LICENSE-MIT) / <http://opensource.org/licenses/MIT>)\n\n# Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n","readmeFilename":"README.md"}