Back to Explore

sindresorhus/get-stream

GitHub
1 watchersOpen source

Last release: 3/16/2024

Get a readable stream’s contents and return them as a string, Buffer, ArrayBuffer, or array, and it can also handle async iterables and object streams. It’s useful when you need to fully consume data from Node.js streams, Web streams, or async iterables, with an optional maximum stream size (maxBuffer) to limit how much is read.

Project status

  • The upstream project appears actively maintained, with a recent upstream push on 2024-10-28 and tagged updates in 2024 (v9.0.0 and v9.0.1).
  • Update cadence looks moderate, with a small cluster of updates in mid-March 2024 (v9.0.0 then a patch v9.0.1 one day later), and then no additional tagged updates shown after v9.0.1.

AI summary generated Today

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v9.0.1

    3/16/2024

    v9.0.1 is a small patch release that primarily upgrades the `ReadableStream[Symbol.asyncIterator]` ponyfill via the `@sec-ant/readable-stream` dependency. The code changes also include an internal refactor around how the ponyfill is wired in, plus some unrelated dependency bumps for dev tooling.

  • v9.0.0

    3/15/2024

    v9.0.0 raises the minimum supported Node.js version to 18 and improves support for both browser and multiple concurrent readers. The implementation was refactored to add environment-aware entrypoints (Node vs browser) and a custom Node-stream async iterator to enable concurrent consumption.

    BreakingFeatures
  • v8.0.1

    8/17/2023

    v8.0.1 contains fixes around the `maxBuffer` option and how much data is retained in `error.bufferedData` when the limit is hit. The implementation refactors internal buffering to support truncating the last chunk so that buffered data can reach the requested limit more accurately.

    Breaking
  • v8.0.0

    8/16/2023

    v8.0.0 substantially expands get-stream beyond Node.js by adding Web Streams and async iterable support, plus new conversion helpers for ArrayBuffer and arrays. It also removes the `encoding` option and reworks stream consumption around a shared internal implementation that enforces `maxBuffer` and attaches `error.bufferedData` when failing.

    BreakingFeatures
  • v7.0.1

    7/1/2023

    Release v7.0.1 includes a small change intended to workaround an issue related to handling large sizes. The code change is in how the internal PassThrough stream is constructed.

  • v7.0.0

    5/26/2023

    v7.0.0 is a major release that turns get-stream into a pure ESM package and modernizes the Node.js requirements to at least Node 16. The API surface is simplified by removing getStream.array and by replacing the old CommonJS property-based exports (buffer and MaxBufferError) with named ESM exports.

    Breaking
  • v6.0.1

    4/15/2021

    v6.0.1 is a small patch release. The only library-facing change visible in the diff is a TypeScript type adjustment for getStream.buffer options, plus repository CI/readme metadata updates.

  • v6.0.0

    8/10/2020

    v6.0.0 makes get-stream require Node.js >= 10 and switches to using Node's native stream.pipeline instead of the pump package. It also changes CommonJS export behavior for TypeScript users, encouraging a move away from default-import patterns.

    Breaking
  • v5.2.0

    8/9/2020

    This release mainly extends `get-stream` so `maxBuffer` can be set up to Node's `Buffer.MAX_LENGTH`. It also adds internal handling to avoid interacting with an oversized internal buffer when errors occur, and includes a new regression test for the MAX_LENGTH edge case.

    Features
  • v5.1.0

    4/5/2019

    v5.1.0 is described as a TypeScript definition refactor to improve CommonJS compatibility. The code diff shows changes to the published TypeScript typings and also a small runtime CommonJS export tweak.