{"name":"it-length-prefixed","version":"10.0.1","keywords":["async","iterable","iterator","length-prefixed","length-prefixed-stream","varint"],"author":{"name":"Alan Shaw"},"license":"Apache-2.0 OR MIT","_id":"it-length-prefixed@10.0.1","maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"alanshaw","email":"alan138@gmail.com"}],"homepage":"https://github.com/alanshaw/it-length-prefixed#readme","bugs":{"url":"https://github.com/alanshaw/it-length-prefixed/issues"},"dist":{"shasum":"a20fb5ca37d27f85dc8ac3f8aea05e20e849d989","tarball":"http://registry-npm.ywwl.com/it-length-prefixed/download/it-length-prefixed-10.0.1.tgz","fileCount":35,"integrity":"sha512-BhyluvGps26u9a7eQIpOI1YN7mFgi8lFwmiPi07whewbBARKAG9LE09Odc8s1Wtbt2MB6rNUrl7j9vvfXTJwdQ==","signatures":[{"sig":"MEUCICLUiERjVDTg7+swWeqR8gPT0aN0WyKiSroBSrZlTN9MAiEAiGQqNXNqTsJ9zqOH+RMZ9taliKYYckQ0Zx9RI9P/XaU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/it-length-prefixed@10.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":52343,"size":13158,"noattachment":false,"key":"/it-length-prefixed/-/it-length-prefixed-10.0.1.tgz"},"type":"module","types":"./dist/src/index.d.ts","engines":{"npm":">=7.0.0","node":">=16.0.0"},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"},"./decode":{"types":"./dist/src/decode.d.ts","import":"./dist/src/decode.js"},"./encode":{"types":"./dist/src/encode.d.ts","import":"./dist/src/encode.js"}},"gitHead":"32cd64f1b80faaae9e02d8f32911b22f7df07f02","release":{"plugins":[["@semantic-release/commit-analyzer",{"preset":"conventionalcommits","releaseRules":[{"release":"major","breaking":true},{"revert":true,"release":"patch"},{"type":"feat","release":"minor"},{"type":"fix","release":"patch"},{"type":"docs","release":"patch"},{"type":"test","release":"patch"},{"type":"deps","release":"patch"},{"scope":"no-release","release":false}]}],["@semantic-release/release-notes-generator",{"preset":"conventionalcommits","presetConfig":{"types":[{"type":"feat","section":"Features"},{"type":"fix","section":"Bug Fixes"},{"type":"chore","section":"Trivial Changes"},{"type":"docs","section":"Documentation"},{"type":"deps","section":"Dependencies"},{"type":"test","section":"Tests"}]}}],"@semantic-release/changelog","@semantic-release/npm","@semantic-release/github","@semantic-release/git"],"branches":["master"]},"scripts":{"docs":"aegir docs","lint":"aegir lint","test":"aegir test","build":"aegir build","clean":"aegir clean","release":"aegir release","dep-check":"aegir dep-check","test:node":"aegir test -t node --cov","test:chrome":"aegir test -t browser --cov","test:firefox":"aegir test -t browser -- --browser firefox","test:electron-main":"aegir test -t electron-main","test:chrome-webworker":"aegir test -t webworker","test:firefox-webworker":"aegir test -t webworker -- --browser firefox"},"_npmUser":{"name":"alanshaw","email":"alan138@gmail.com"},"repository":{"url":"git+https://github.com/alanshaw/it-length-prefixed.git","type":"git"},"_npmVersion":"10.9.2","description":"Streaming length prefixed buffers with async iterables","directories":{},"_nodeVersion":"22.13.1","dependencies":{"it-reader":"^6.0.1","uint8arrays":"^5.0.1","uint8-varint":"^2.0.1","uint8arraylist":"^2.0.0","it-stream-types":"^2.0.1"},"eslintConfig":{"extends":"ipfs","parserOptions":{"project":true,"sourceType":"module"},"ignorePatterns":["benchmarks"]},"publishConfig":{"access":"public","provenance":true},"typesVersions":{"*":{"*":["*","dist/*","dist/src/*","dist/src/*/index"],"src/*":["*","dist/*","dist/src/*","dist/src/*/index"]}},"_hasShrinkwrap":false,"devDependencies":{"aegir":"^45.0.8","it-all":"^3.0.0","it-map":"^3.0.0","it-pipe":"^3.0.0","p-defer":"^4.0.0","it-block":"^6.0.0","it-drain":"^3.0.0","it-foreach":"^2.0.0","random-int":"^3.0.0","it-pushable":"^3.0.0","iso-random-stream":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/it-length-prefixed_10.0.1_1739437728688_0.9201512740283202","host":"s3://npm-registry-packages-npm-production"},"readme":"# it-length-prefixed\n\n[![codecov](https://img.shields.io/codecov/c/github/alanshaw/it-length-prefixed.svg?style=flat-square)](https://codecov.io/gh/alanshaw/it-length-prefixed)\n[![CI](https://img.shields.io/github/actions/workflow/status/alanshaw/it-length-prefixed/js-test-and-release.yml?branch=master\\&style=flat-square)](https://github.com/alanshaw/it-length-prefixed/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)\n\n> Streaming length prefixed buffers with async iterables\n\n# About\n\n<!--\n\n!IMPORTANT!\n\nEverything in this README between \"# About\" and \"# Install\" is automatically\ngenerated and will be overwritten the next time the doc generator is run.\n\nTo make changes to this section, please update the @packageDocumentation section\nof src/index.js or src/index.ts\n\nTo experiment with formatting, please run \"npm run docs\" from the root of this\nrepo and examine the changes made.\n\n-->\n\nEncode/decode streams of bytes with length-prefixes.\n\n## Example\n\n```js\nimport { pipe } from 'it-pipe'\nimport * as lp from 'it-length-prefixed'\n\nconst encoded = []\n\n// encode\nawait pipe(\n  [uint8ArrayFromString('hello world')],\n  (source) => lp.encode(source),\n  async source => {\n    for await (const chunk of source) {\n      encoded.push(chunk.slice()) // (.slice converts Uint8ArrayList to Uint8Array)\n    }\n  }\n)\n\nconsole.log(encoded)\n// => [Buffer <0b 68 65 6c 6c 6f 20 77 6f 72 6c 64>]\n\nconst decoded = []\n\n// decode\nawait pipe(\n  encoded, // e.g. from above\n  (source) => lp.decode(source),\n  async source => {\n    for await (const chunk of source) {\n      decoded.push(chunk.slice()) // (.slice converts Uint8ArrayList to Uint8Array)\n    }\n  }\n)\n\nconsole.log(decoded)\n// => [Buffer <68 65 6c 6c 6f 20 77 6f 72 6c 64>]\n```\n\n# API Docs\n\n- <https://alanshaw.github.io/it-length-prefixed>\n\n# License\n\nLicensed under either of\n\n- Apache 2.0, ([LICENSE-APACHE](https://github.com/alanshaw/it-length-prefixed/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)\n- MIT ([LICENSE-MIT](https://github.com/alanshaw/it-length-prefixed/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","publish_time":1739437728930,"_cnpm_publish_time":1739437728930,"dist-tags":{"latest":"11.0.1"}}