v8.0.0
Huge thanks to @ehmicky for doing all the work for this release 馃檶
Breaking
- Remove the
encoding
option. (#69, #67)- This package handles binary, UTF-8 and object streams.
- For other encodings like UTF-16, hexacimal and base64, please see the following tip. (#84)
- Methods like
buffer.toString('hex')
orbuffer.toString('base64')
can also be used.
Improvements
- Support any JavaScript environment, including browsers. (#85)
- Support web streams (
ReadableStream
). (#82, #78, #79, #80) - Support async iterables. (#69, #93)
- Add
getStreamAsArray()
method to pass streams in object mode. (#86) - Add
getStreamAsArrayBuffer()
method to return the stream as anArrayBuffer
. (#81) - When the stream is larger than the maximum size for a string, buffer or
ArrayBuffer
, seterror.bufferedData
with the partially read data instead of leaving it empty. (#68, #48)
Fixes
- Do not crash on big streams (with one/many GBs). (#66)
- Ensure
maxBuffer
stops infinite streams. (#62) - Stop consuming the streaming when hitting
maxBuffer
. (#42, #69). - Set
error.bufferedData
when the stream errors for other reasons thanmaxBuffer
. (#56, #63) - Ensure
error.bufferedData
is smaller thanmaxBuffer
. (#89)
TypeScript types
- The
stream
argument must be aReadable
,ReadableStream
orAsyncIterable
. (#71)
Documentation
- Add tips on alternatives,
Blob
and JSON streaming. (#58, #95, #96, #97)
Performance
- Do not block the event loop when the stream ends. (#92)