{"name":"it-length-prefixed","version":"9.1.0","description":"Streaming length prefixed buffers with async iterables","author":{"name":"Alan Shaw"},"license":"Apache-2.0 OR MIT","homepage":"https://github.com/alanshaw/it-length-prefixed#readme","repository":{"type":"git","url":"git+https://github.com/alanshaw/it-length-prefixed.git"},"bugs":{"url":"https://github.com/alanshaw/it-length-prefixed/issues"},"publishConfig":{"access":"public","provenance":true},"keywords":["async","iterable","iterator","length-prefixed","length-prefixed-stream","varint"],"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"},"./decode":{"types":"./dist/src/decode.d.ts","import":"./dist/src/decode.js"},"./encode":{"types":"./dist/src/encode.d.ts","import":"./dist/src/encode.js"}},"eslintConfig":{"extends":"ipfs","parserOptions":{"project":true,"sourceType":"module"},"ignorePatterns":["benchmarks"]},"release":{"branches":["master"],"plugins":[["@semantic-release/commit-analyzer",{"preset":"conventionalcommits","releaseRules":[{"breaking":true,"release":"major"},{"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"]},"scripts":{"clean":"aegir clean","lint":"aegir lint","dep-check":"aegir dep-check","build":"aegir build","test":"aegir test","test:chrome":"aegir test -t browser --cov","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":"aegir release","docs":"aegir docs"},"dependencies":{"it-reader":"^6.0.1","it-stream-types":"^2.0.1","uint8-varint":"^2.0.1","uint8arraylist":"^2.0.0","uint8arrays":"^5.0.1"},"devDependencies":{"aegir":"^44.1.0","iso-random-stream":"^2.0.0","it-all":"^3.0.0","it-block":"^6.0.0","it-drain":"^3.0.0","it-foreach":"^2.0.0","it-map":"^3.0.0","it-pipe":"^3.0.0","it-pushable":"^3.0.0","p-defer":"^4.0.0","random-int":"^3.0.0"},"engines":{"node":">=16.0.0","npm":">=7.0.0"},"_id":"it-length-prefixed@9.1.0","gitHead":"aca5684bd71d2e026741ec5358d0a94a34335e15","_nodeVersion":"20.16.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-kx2UTJuy7/lsT3QUzf50NjfxU1Z4P4wlvYp6YnR5Nc61P8XKfy+QtiJi1VLojA+Kea7vMbB4002rIij1Ol9hcw==","shasum":"19d5d336068fdcbbadfafb1eb33331a9370d4cac","tarball":"http://registry-npm.ywwl.com/it-length-prefixed/download/it-length-prefixed-9.1.0.tgz","fileCount":30,"unpackedSize":51267,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/it-length-prefixed@9.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCsSIU2+6kko9zB5Dtp+Y5+wiDBiZliXtqQ3f6/9VgTuQIgeW3hqpYJEticj/Dx7k0Y+tsQMAMXWO1vA0OmeQ+JgRU="}],"size":12844,"noattachment":false,"key":"/it-length-prefixed/-/it-length-prefixed-9.1.0.tgz"},"_npmUser":{"name":"alanshaw","email":"alan138@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/it-length-prefixed_9.1.0_1723105674838_0.868172274428616"},"_hasShrinkwrap":false,"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":1723105675010,"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"alanshaw","email":"alan138@gmail.com"}],"_cnpm_publish_time":1723105675010,"dist-tags":{"latest":"11.0.1"}}