API Reference

get-stream

Gets the contents of a stream as a string, buffer, or array with promise interface.

Official Documentation ↗
CompatibilityThis documentation covers version v9.0.1. Check the official docs for the latest API surface.

Installation

npmnpm install get-stream
pnpmpnpm add get-stream

Methods

get-stream is gets the contents of a stream as a string, buffer, or array with promise interface.

Key Features

  • data-fetching: Designed for data fetching scenarios with a focused API surface.

Installation

npm install get-stream

Usage

Errors

The following points are quoted verbatim from the official documentation. 来源:https://cdn.jsdelivr.net/gh/sindresorhus/get-stream@latest/readme.md · 取证方式:HTTP GET 官方 README/文档页(HTML 去标签) · 抓取时间:2026-11-07T13:49:46.921Z. Any error type, throw condition or recovery step not stated there is left unspecified; this page does not infer exception classes or return values.

FAQ

What is backpressure?
When a writable stream cannot keep up, write() returns false. Pause the source or wait for the drain event before writing more.
How do I handle stream errors?
Always listen for the error event on every stream in the pipeline; unhandled error events crash the process.
Should I use pipe or pipeline?
Prefer pipeline() from stream/promises; it properly cleans up all streams on error, unlike pipe().