{"name":"minipass-sized","version":"2.0.0","description":"A Minipass stream that raises an error if you get a different number of bytes than expected","author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"license":"ISC","scripts":{"test":"tap","snap":"tap","pretest":"npm run prepare","presnap":"npm run prepare","prepare":"tshy","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","format":"prettier --write . --log-level warn","typedoc":"typedoc"},"devDependencies":{"prettier":"^3.7.4","tap":"^21.5.0","tshy":"^3.1.0","typedoc":"^0.28.15"},"dependencies":{"minipass":"^7.1.2"},"main":"./dist/commonjs/index.js","keywords":["minipass","size","length"],"directories":{"test":"test"},"repository":{"type":"git","url":"git+https://github.com/isaacs/minipass-sized.git"},"engines":{"node":">=8"},"type":"module","tshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts"}},"exports":{"./package.json":"./package.json",".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}}},"types":"./dist/commonjs/index.d.ts","module":"./dist/esm/index.js","gitHead":"6bfc4bf784d68ae84f61e0ddfb9415d424fc17fd","_id":"minipass-sized@2.0.0","bugs":{"url":"https://github.com/isaacs/minipass-sized/issues"},"homepage":"https://github.com/isaacs/minipass-sized#readme","_nodeVersion":"24.4.1","_npmVersion":"11.6.3","dist":{"integrity":"sha512-zSsHhto5BcUVM2m1LurnXY6M//cGhVaegT71OfOXoprxT6o780GZd792ea6FfrQkuU4usHZIUczAQMRUE2plzA==","shasum":"2228ee97e3f74f6b22ba6d1319addb7621534306","tarball":"http://registry-npm.ywwl.com/minipass-sized/download/minipass-sized-2.0.0.tgz","fileCount":13,"unpackedSize":22536,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDf1zwPLZsiSuE3Jn8WjzKPlM53/CunoaDfvIASR9HCjgIhALamPYwLjvEEcKBWhM+t1sqZhsLsPNJAh2efc9RN36d/"}],"size":4579,"noattachment":false,"key":"/minipass-sized/-/minipass-sized-2.0.0.tgz"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/minipass-sized_2.0.0_1767817299626_0.4635247529223119"},"_hasShrinkwrap":false,"readme":"# minipass-sized\n\nA Minipass stream that raises an error if you get a different\nnumber of bytes than expected.\n\n## USAGE\n\nUse just like any old [minipass](http://npm.im/minipass) stream,\nbut provide a `size` option to the constructor.\n\nThe `size` option must be a positive integer, smaller than\n`Number.MAX_SAFE_INTEGER`.\n\n```ts\nimport { MinipassSized } from 'minipass-sized'\n// or:\n// const { MinipassSized } = require('minipass-sized')\n// figure out how much data you expect to get\nconst expectedSize = +headers['content-length']\nconst stream = new MinipassSized({ size: expectedSize })\nstream.on('error', er => {\n  // if it's the wrong size, then this will raise an error with\n  // { found: <number>, expect: <number>, code: 'EBADSIZE' }\n})\nresponse.pipe(stream)\n```\n\nCaveats: this does not work with `objectMode` streams, and will\nthrow a `TypeError` from the constructor if the size argument is\nmissing or invalid.\n","publish_time":1767817299790,"_cnpm_publish_time":1767817299790,"dist-tags":{"latest":"2.0.0"}}