get-stream
9.0.1 · 16 Mar 2024MIT293.1M / weekRepositoryHomepagenpmAtom feed
8.0.1 is the newest release of 8.x.
In short
1 breaking5 new1 faster4 fixed1 changed1 internal
- Breaking
Remove the
encodingoption. (#69, #67)
Release note
Breaking
- Breaking
Remove the
encodingoption. (#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.
Methods like
buffer.toString('hex')orbuffer.toString('base64')can also be used.
Improvements
Support any JavaScript environment, including browsers.
Support web streams (
ReadableStream). (#82, #78, #79, #80)Support async iterables. (#69, #93)
Add
getStreamAsArray()method to pass streams in object mode.Add
getStreamAsArrayBuffer()method to return the stream as anArrayBuffer.When the stream is larger than the maximum size for a string, buffer or
ArrayBuffer, seterror.bufferedDatawith the partially read data instead of leaving it empty. (#68, #48)
Fixes
Do not crash on big streams (with one/many GBs).
Ensure
maxBufferstops infinite streams.Stop consuming the streaming when hitting
maxBuffer. (#42, #69).Set
error.bufferedDatawhen the stream errors for other reasons thanmaxBuffer. (#56, #63)Ensure
error.bufferedDatais smaller thanmaxBuffer.
TypeScript types
The
streamargument must be aReadable,ReadableStreamorAsyncIterable.
Performance
Do not block the event loop when the stream ends.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.