get-stream
9.0.1 · 16 Mar 2024MIT293.1M / weekRepositoryHomepagenpmAtom feed
22 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 9.x · latest line
- 8.x
8.0.1
17 Aug 2023Ensure
error.bufferedDatais as full as possible.Fix the
maxBufferoption being one byte off in some edge case.
8.0.0
16 Aug 2023Support any JavaScript environment, including browsers.
Support web streams (
ReadableStream). (#82, #78, #79, #80)
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.
- 7.x
7.0.0
26 May 2023- Breaking
Require Node.js 16 70571f8
- Breaking
This package is now pure ESM. Please read this.
- Breaking
Removed
getStream.array()
Breaking
- Breaking
Require Node.js 16 70571f8
- Breaking
This package is now pure ESM. Please read this.
- Breaking
Removed
getStream.array()It complicated the codebase considerably and I personally never used it.
You can use
readableStream.toArray()instead. Example
- Breaking
const getStream = require('get-stream'); getStream.buffer(…);→import {getStreamAsBuffer} from 'get-stream'; getStreamAsBuffer(…); - Breaking
const getStream = require('get-stream'); getStream.MaxBufferError;→import {MaxBufferError} from 'get-stream'; MaxBufferError;
Tip
You may not need this package anymore.
- 6.x
- 5.x
- 4.x
- 3.x
3.0.0
23 Nov 2016- 2.x
- 1.x
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.