← All notes

Node.js streams - pipeline, finished and objectMode

Answer: The node:stream module is an API for implementing the stream interface. Node.js ships many stream objects. pipeline from node:stream/promises hooks readable, transform, and writable streams together.

Examples

import { pipeline } from 'node:stream/promises';
import { createReadStream, createWriteStream } from 'node:fs';
import { createGzip } from 'node:zlib';

await pipeline(
  createReadStream('in.txt'),
  createGzip(),
  createWriteStream('out.txt.gz'),
);

Rules

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Node.js API docs, Stream; nodejs/node (GitHub), doc/api/stream.md. MIT (https://raw.githubusercontent.com/nodejs/node/main/LICENSE). Copyright Node.js contributors. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Node.js API docs, Stream; nodejs/node (GitHub), doc/api/stream.md. MIT (https://raw.githubusercontent.com/nodejs/node/main/LICENSE). Copyright Node.js contributors.

Cite this

Permanent ID: iil:note:ytd6q6nw

iinventedlight. 2026. "Node.js streams - pipeline, finished and objectMode." iinventedlight Library, iil:note:ytd6q6nw, version of 2026-11-18. https://iinventedlight.com/library/notes/node-stream/. License: CC-BY-4.0.

@misc{iil_note_ytd6q6nw,
  author = {{iinventedlight}},
  title = {{Node.js streams - pipeline, finished and objectMode}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-18},
  url = {https://iinventedlight.com/library/notes/node-stream/},
  note = {Permanent ID iil:note:ytd6q6nw. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/node-stream.md.