Skip to content

Comments

doc: improve stream.compose documentation clarity#61975

Open
turanalmammadov wants to merge 1 commit intonodejs:mainfrom
turanalmammadov:doc-stream-compose-clarify
Open

doc: improve stream.compose documentation clarity#61975
turanalmammadov wants to merge 1 commit intonodejs:mainfrom
turanalmammadov:doc-stream-compose-clarify

Conversation

@turanalmammadov
Copy link

Improves the stream.compose documentation to address confusion raised in #40812:

  1. Clarify Duplex vs Duplex.from: When composing multiple streams, all must be Duplex streams (e.g. transforms) that get piped together. For combining a write-only stream with a read-only stream without piping, use stream.Duplex.from({ writable, readable }) instead.

  2. Explain readable/writable Duplex terminology: The terms "readable Duplex" and "writable Duplex" refer to Duplex instances with configurable readable and writable options where only one side is used. This addresses the confusion about how a "readable Duplex" or "writable Duplex" can exist when Duplex implies both directions.

Refs: #40812

Made with Cursor

- Clarify that compose requires Duplex streams (transforms) when piping
  multiple streams; add reference to Duplex.from for combining
  write-only + read-only streams without piping
- Explain 'readable Duplex' and 'writable Duplex' terminology: Duplex
  instances with configurable readable/writable options where only one
  side is used

Refs: nodejs#40812
Co-authored-by: Cursor <cursoragent@cursor.com>
@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. stream Issues and PRs related to the stream subsystem. labels Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Issues and PRs related to the documentations. stream Issues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants