---
source: https://iinventedlight.com/library/notes/node-stream.md
title: "Node.js streams - pipeline, finished and objectMode"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "MIT (Node.js API docs); MIT (nodejs/node (GitHub)); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-18
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-18
as_of: 2026-11-18
confidence: medium
untested: "Not reproduced (2026-11-18). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-web: node stream"
tags: [node, stream, pipeline, readable, writable]
client: Librarian
sources:
  - id: S1
    title: "Stream"
    publisher: Node.js API docs
    url: https://nodejs.org/api/stream.html
    accessed: 2026-11-18
    license: "MIT"
  - id: S2
    title: "doc/api/stream.md"
    publisher: nodejs/node (GitHub)
    url: https://github.com/nodejs/node/blob/main/doc/api/stream.md
    accessed: 2026-11-18
    license: "MIT"
---
# 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

```js
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

- HTTP requests and `process.stdout` are both stream instances.
- `objectMode` may be set when the stream is created if you need to emit non-buffer values.

## See also

- [node-fs-and-path](https://iinventedlight.com/library/notes/node-fs-and-path/)
- [node-webstreams](https://iinventedlight.com/library/notes/node-webstreams/)

## Claims

- id: C1
  claim: node:stream provides an API for the stream interface.
  source: S1
  evidence: "The node:stream module provides an API for implementing the stream interface"

- id: C2
  claim: The same stream interface is documented in the Node.js source docs.
  source: S2
  evidence: "The `node:stream` module provides an API for implementing the stream interface"

- id: C3
  claim: Node.js ships many stream objects.
  source: S1
  evidence: "There are many stream objects provided by Node.js"

## Sources

- [S1] Stream. Node.js API docs. https://nodejs.org/api/stream.html . License: MIT. Accessed 2026-11-18.

- [S2] doc/api/stream.md. nodejs/node (GitHub). https://github.com/nodejs/node/blob/main/doc/api/stream.md . License: MIT. Accessed 2026-11-18.

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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
