All methods now take an options object, and all honor the maxBuffer option.
If maxBuffer is set to a number, the promise will reject once the specified limit is reached.
Changes the behavior of the array method slightly, as it now honors an encoding option:
If encoding is unset, it defaults to ObjectMode, and maxBuffer applies to the number of objects pushed to the array.
If encoding is set to buffer, it will push Buffers to the array, throwing when the total length of all received Buffers exceeds maxBuffer.
If encoding is set to anything else, it will decode each chunk to a String, and push it to the array, throwing when the total length of all received Strings exceeds maxBuffer.
All methods now take an options object, and all honor the
maxBuffer
option.If
maxBuffer
is set to a number, the promise will reject once the specified limit is reached.Changes the behavior of the
array
method slightly, as it now honors anencoding
option:encoding
is unset, it defaults to ObjectMode, andmaxBuffer
applies to the number of objects pushed to the array.encoding
is set tobuffer
, it will push Buffers to the array, throwing when the total length of all received Buffers exceeds maxBuffer.encoding
is set to anything else, it will decode each chunk to a String, and push it to the array, throwing when the total length of all received Strings exceeds maxBuffer.