{"name":"minipass-sized","version":"1.0.1","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":"e0251eabfa4c828c517b694ecb0de51be782dd7c","bugs":{"url":"https://github.com/isaacs/minipass-sized/issues"},"homepage":"https://github.com/isaacs/minipass-sized#readme","_id":"minipass-sized@1.0.1","_nodeVersion":"12.8.1","_npmVersion":"6.11.3","dist":{"integrity":"sha512-aSxYBRYK8b1W26nDi86sbPyloADK0RiEWWIfF0fVvgF5y5WHqzWDjt/VBJXkBkMS3YsEb03JDTwhmKVwqElcBA==","shasum":"e47f37edd05a1c3e9ec8974ecccd35451842cb02","tarball":"http://registry-npm.ywwl.com/minipass-sized/download/minipass-sized-1.0.1.tgz","fileCount":7,"unpackedSize":123037,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdhq9TCRA9TVsSAnZWagAAXxUQAJ3n0KcL2movulOxPtus\nU1OtEV7bqA+tNzSU2cSr+1wztjp6lJmNR2iu2NpvC5MrVhf+u4jRrRjBQXzD\nK5J14pP5FW0FzmxP53EOJ9koZ8IuiynepNyxnmAKlMxEybFVRAfyLKECgEKM\nwnqLtwNDgU9F38QaDoUon6wKKHwKQVlQMumwru3LdYh6gjkE/kt3Bk+GF4Q0\n4cwLsLt1hxllPMKEV8Bo4oBVPHI0BOF8zmBU04JdCJdsseBC2PryNJ6nQ64I\nwOu96T+fPTiGJn9jo9fbjiTnicT2Y3B2YQMrLl3eYDO17q8TeRuJtVsllKiW\nDs5c7ddc4t5IPSEDwICBPB/ERHOb5shMHyuKuJjGMxgqkTASGj+qywH0ob2s\n/H+qYzBBVYbEoQhCzgRftmZTwHJSQ6KGUEl4tu1EBIqCuvD86HoJ4pdZ+e8O\nc5xVO0J7lX2WgF9QdzE3yCmxF63CoFYwZRs+O4Daz2ngil1EAjob9IDqEw6I\nMp7SPs0/rDOU65a8Dejft4MrMNNdMwlmoDQrkeB1RYZEEkOlE6JIF3yDXCd8\nI8saMiZYmGbm6cY/9fimmoBD2SHhoGVFT9guyrNcD9ExnMryMN1diKgyzM0D\nUWjVjYROX+wVmf0sAaU3HgFkOA/shp7GjNp/xxhrhAWExGkgNGAQdTDSDoxN\npKTx\r\n=uo9/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGU+ajq1Ku49SA+ZAqG37IB6kLLLXzVfUSvIL0JsajRSAiEAo9mgu4i4B+B1Ht62fkoOa6onj8BYxiqYbpMlPA2UG/w="}],"size":30532,"noattachment":false,"key":"/minipass-sized/-/minipass-sized-1.0.1.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.1_1569107794649_0.4339924043247734"},"_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":1569107794822,"_cnpm_publish_time":1569107794822,"dist-tags":{"latest":"2.0.0"}}