Skip to content

Expose internal stream utils #39641

@ronag

Description

@ronag

I think it would be useful for the ecosystem if we exposed some of our stream utility function from https://github.com/nodejs/node/blob/master/lib/internal/streams/utils.js.

In particular:

isReadableNodeStream(obj)
isWritableNodeStream(obj)
isNodeStream(obj)
isDestroyed(stream)
isWritableEnded(stream)
isWritableFinished(stream, strict)
isReadableEnded(stream)
isReadableFinished(stream, strict)
isReadable(stream)
isWritable(stream)
isFinished(stream, opts) 
isClosed(stream)
isDisturbed(stream)

Additionally maybe some that we don't have yet:

isAborted(stream)

One problem I see atm is the confusion/ambiguity between web and node streams, e.g. in #39628 we are working on isDisturbed which works no both node and web streams.

Metadata

Metadata

Assignees

No one assigned

    Labels

    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