A Minipass stream that raises an error if you get a different number of bytes than expected.
Use just like any old minipass stream, but
size option to the constructor.
size option must be a positive integer, smaller than
const MinipassSized =// figure out how much data you expect to getconst expectedSize = +headers'content-length'const stream = size: expectedSizestreamresponse
Caveats: this does not work with
objectMode streams, and will throw a
TypeError from the constructor if the size argument is missing or