{"name":"minipass-sized","version":"1.0.2","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","preversion":"npm test","postversion":"npm publish","postpublish":"git push origin --follow-tags"},"tap":{"check-coverage":true},"devDependencies":{"tap":"^14.6.4"},"dependencies":{"minipass":"^2.6.5"},"main":"index.js","keywords":["minipass","size","length"],"directories":{"test":"test"},"repository":{"type":"git","url":"git+https://github.com/isaacs/minipass-sized.git"},"gitHead":"e49f02e0eea8d86ce0c998b8ae221d1bdc7fc283","bugs":{"url":"https://github.com/isaacs/minipass-sized/issues"},"homepage":"https://github.com/isaacs/minipass-sized#readme","_id":"minipass-sized@1.0.2","_nodeVersion":"12.8.1","_npmVersion":"6.11.3","dist":{"integrity":"sha512-x2sUm+4EXoi6HYnuedXFSDt8yBTOr41yliNCP6dLziFoDCvJolw9+OKHYtd9sLUdkp/AWvj89Od9msIGfScQDg==","shasum":"648d3eaeae68892b900c66d34a5a5eeda7e1b9bd","tarball":"http://registry-npm.ywwl.com/minipass-sized/download/minipass-sized-1.0.2.tgz","fileCount":7,"unpackedSize":123128,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdhrDbCRA9TVsSAnZWagAAFesP/3c3wFt2HfIiLBYgUGeX\n8s2Sv+oJRPwVDZFKLcIgdJCJsoaI58roty1ks6Fu7ceZytXRf0hILFj0+B8+\nIsrmoxWFXHq8EU86cxghVM7HC6ou3HSfYR4bPa9Qn3NHWAZj8XkO0JtVreod\nNpg7N9NTQPKQ3Mz/wZYJ9XpmpJfXOn/4jm130VYeGNE38EgS2Ztkm1PxJ+0l\nbshgn9iF4x79153XPt3yqmC5LdSWrbxw5BNzQiCtYAlDR6BJRlJHYAh64OdV\nC1jG7XPnC5MtRSEK0iE/ouUajp5j+4kZbxc9FbXJUXtL9gjYq+o9eezUfYdW\n9313g6C9HZSFx94ssXpADuT7VKSlP+4mXigu8nghTWZ05tO7os7hFGTW6HS0\n6MGmzhAdTXOejbWTvu9LN5TRSiBJbtHVfTVGBVwa9cLgEqKAWyG4xY6TaD+8\nkQu0yuDAb2CtbPTqYVOfnHBQwOKgaxaKmPwWdvFvtG5VEX+rBv4bw+DEoTSj\nTPhANwjnX4WC1Cb9YX+CBZ4KWGulP1Ei2Atcs/94G42mqpecA1xFgsoukOUU\nc1QxiuA40l1lKYiMAjtKiBOZWjWvrt0SJQoPN8CQ7PO7tIfqS36a2x+0ZWbA\nGnY1uYim2QbH/SAMUILuVCGANadM9LxDhdeD59MPp9gy3VrLYIJL6A3kaRdA\nbB9K\r\n=gm3y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCb8XVpHUcaQL9x2cgBzuTUHa0dwixoDCfaqvvIsYB/kwIgU1OmseCaMuJm/BWB4wU4y4UcT1w1GivdGKpMPHk5DDo="}],"size":30560,"noattachment":false,"key":"/minipass-sized/-/minipass-sized-1.0.2.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"_npmUser":{"name":"isaacs","email":"i@izs.me"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/minipass-sized_1.0.2_1569108186749_0.22612875154912793"},"_hasShrinkwrap":false,"readme":"# minipass-sized\n\nA Minipass stream that raises an error if you get a different number of\nbytes than expected.\n\n## USAGE\n\nUse just like any old [minipass](http://npm.im/minipass) stream, but\nprovide a `size` option to the constructor.\n\nThe `size` option must be a positive integer, smaller than\n`Number.MAX_SAFE_INTEGER`.\n\n```js\nconst 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 throw a\n`TypeError` from the constructor if the size argument is missing or\ninvalid.\n","publish_time":1569108186858,"_cnpm_publish_time":1569108186858,"dist-tags":{"latest":"2.0.0"}}