Skip to content

stream.compose documentation could be better #40812

@JoakimCh

Description

@JoakimCh

Version

17.1.0

Platform

Linux

Subsystem

stream

What steps will reproduce the bug?

No response

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

const duplexStream = duplexer3(subprocess.stdin, subprocess.stdout) // this one works
const duplexStream =   compose(subprocess.stdin, subprocess.stdout) // this one doesn't

Is it not supposed to work the same as duplexer3?

The error I get:
The argument 'streams[0]' must be readable.

EDIT:
This was a misunderstanding on my behalf, I tried to find an alternative to duplexer3 and mistook stream.compose for having the same functionality. Instead stream.Duplex.from({writable, readable}) actually has the functionality I was looking for!

Further down I figured out my mistake and suggested which changes could be done to the documentation to make it clearer.

Metadata

Metadata

Assignees

Labels

docIssues and PRs related to the documentations.streamIssues and PRs related to the stream subsystem.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions