{"name":"minipass-sized","version":"1.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","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":"f43f1c3bc294ea6e6b44b3c74a71865ad358ec96","bugs":{"url":"https://github.com/isaacs/minipass-sized/issues"},"homepage":"https://github.com/isaacs/minipass-sized#readme","_id":"minipass-sized@1.0.0","_nodeVersion":"12.8.1","_npmVersion":"6.11.3","dist":{"integrity":"sha512-nlv+3YPnfjgs0WJwlNGSEE66oYOsLSWDPsWXin8/AhrHM6/IjxAV5GkHmFdWya92AsKvXZZKWAORp/qohNrUVA==","shasum":"35ef931e8f3a5d9471fce6205764a13b5a286454","tarball":"http://registry-npm.ywwl.com/minipass-sized/download/minipass-sized-1.0.0.tgz","fileCount":7,"unpackedSize":122870,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdhq62CRA9TVsSAnZWagAABQUQAIj2pu/X0oB5Bx/XaO6Y\nEAX4ASqMpR0uMbN0j/ul3SSULbtn1+6PTU+qhLfzF6pAb2h7T0VXAqU7q5Gg\nRtv5EnroKbWRcXYSO6zwfJiBSqI/7SPj6T6t6r9ZjAcIiShGpJHZtVNUwqnc\n001N9RKS5TU2pTfcoP3y1rOHyadKLfzGTWXkoHPp8b3z+4JtW620uCtHVb+F\nJFymSNuTzYm+1BAtTL2XgxBsqmiAGg5Npv+NvfRe/M6pQUEeluBD+r4QNnBh\nWh1NxIEsRZ6t/ddfv4Uzo6GLtjOdr6tisUzs5tzveezqOkCa41qkEvPmcHML\nkjJXEYXfMODoj3Jxyr4726MH95g0eTJeJUK2IrEAUPakHgj4fF2wW5Cv4Zua\npGJlL7mI4ZUOVTgBrHhWpSRJhI1gm4WZFSd9cmIJ/Tkz4WFaH0gVxCc5yAZ9\nhiVUnh4pBSB5NVeeSqrIDvThxTVXqHuP+YqqG2xHxAXPGA3Y04Qzwz6J7Yv+\nYjvDsHn0gl5PFDjkLFbfbaCKkWKbsbFoyIjW/dpoR0V1ebeBsXJBwSz6siAm\n1hNXRb5J2NaKY4yEL1aaAXjsCY85lQHctsgsOG3FdKDWI91HpQL2vzVyR6JY\nTyHDFNXxtWyaIG7mdRGbtx0cqvQ+8alf9EWZ3XPm9FMK16QUxSRBu0aSw39p\nugdH\r\n=RZ8Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGQ8ZRS6ialN7frsuHpQO9Ip218+sWm8NbHZflxOzSKnAiApi1XSCdIhU2mrHvZZIsy7MyPpFj5bs0D5rZwO+dHnMQ=="}],"size":30479,"noattachment":false,"key":"/minipass-sized/-/minipass-sized-1.0.0.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.0_1569107638213_0.7654586174350935"},"_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":1569107638383,"_cnpm_publish_time":1569107638383,"dist-tags":{"latest":"2.0.0"}}