deno.com

Usage in Deno

import * as mod from "node:stream";

A stream is an abstract interface for working with streaming data in Node.js. The node:stream module provides an API for implementing the stream interface.

There are many stream objects provided by Node.js. For instance, a request to an HTTP server and process.stdout are both stream instances.

Streams can be readable, writable, or both. All streams are instances of EventEmitter.

To access the node:stream module:

import stream from 'node:stream';

The node:stream module is useful for creating new types of stream instances. It is usually not necessary to use the node:stream module to consume streams.

Classes #

c
N
default
No documentation available
c
I
default.Duplex

Duplex streams are streams that implement both the Readable and Writable interfaces.

c
default.PassThrough

The stream.PassThrough class is a trivial implementation of a Transform stream that simply passes the input bytes across to the output. Its purpose is primarily for examples and testing, but there are some use cases where stream.PassThrough is useful as a building block for novel sorts of streams.

    c
    default.Transform

    Transform streams are Duplex streams where the output is in some way related to the input. Like all Duplex streams, Transform streams implement both the Readable and Writable interfaces.

    c
    N
    Stream
    No documentation available
    c
    I
    Stream.Duplex

    Duplex streams are streams that implement both the Readable and Writable interfaces.

    c
    Stream.PassThrough

    The stream.PassThrough class is a trivial implementation of a Transform stream that simply passes the input bytes across to the output. Its purpose is primarily for examples and testing, but there are some use cases where stream.PassThrough is useful as a building block for novel sorts of streams.

      c
      Stream.Transform

      Transform streams are Duplex streams where the output is in some way related to the input. Like all Duplex streams, Transform streams implement both the Readable and Writable interfaces.

      Functions #

      f
      default.addAbortSignal

      A stream to attach a signal to.

        f
        default.duplexPair

        The utility function duplexPair returns an Array with two items, each being a Duplex stream connected to the other side:

          f
          N
          default.finished

          A readable and/or writable stream/webstream.

            f
            default.finished.__promisify__
            No documentation available
              f
              default.getDefaultHighWaterMark

              Returns the default highWaterMark used by streams. Defaults to 65536 (64 KiB), or 16 for objectMode.

                f
                default.isErrored

                Returns whether the stream has encountered an error.

                  f
                  default.isReadable

                  Returns whether the stream is readable.

                    f
                    N
                    default.pipeline

                    A module method to pipe between streams and generators forwarding errors and properly cleaning up and provide a callback when the pipeline is complete.

                      f
                      default.pipeline.__promisify__
                      No documentation available
                        f
                        default.setDefaultHighWaterMark

                        Sets the default highWaterMark used by streams.

                          f
                          Stream.addAbortSignal

                          A stream to attach a signal to.

                            f
                            Stream.duplexPair

                            The utility function duplexPair returns an Array with two items, each being a Duplex stream connected to the other side:

                              f
                              N
                              Stream.finished

                              A readable and/or writable stream/webstream.

                                f
                                Stream.finished.__promisify__
                                No documentation available
                                  f
                                  Stream.getDefaultHighWaterMark

                                  Returns the default highWaterMark used by streams. Defaults to 65536 (64 KiB), or 16 for objectMode.

                                    f
                                    Stream.isErrored

                                    Returns whether the stream has encountered an error.

                                      f
                                      Stream.isReadable

                                      Returns whether the stream is readable.

                                        f
                                        N
                                        Stream.pipeline

                                        A module method to pipe between streams and generators forwarding errors and properly cleaning up and provide a callback when the pipeline is complete.

                                          f
                                          Stream.pipeline.__promisify__
                                          No documentation available
                                            f
                                            Stream.setDefaultHighWaterMark

                                            Sets the default highWaterMark used by streams.

                                              Interfaces #

                                              Type Aliases #

                                              T
                                              ComposeFnParam
                                              No documentation available
                                                T
                                                default.PipelineCallback
                                                No documentation available
                                                  T
                                                  default.PipelineDestination
                                                  No documentation available
                                                    T
                                                    default.PipelinePromise
                                                    No documentation available
                                                      T
                                                      default.PipelineSource
                                                      No documentation available
                                                        T
                                                        default.PipelineSourceFunction
                                                        No documentation available
                                                          T
                                                          default.PipelineTransform
                                                          No documentation available
                                                            T
                                                            default.PipelineTransformSource
                                                            No documentation available
                                                              T
                                                              default.TransformCallback
                                                              No documentation available
                                                                T
                                                                Stream.PipelineCallback
                                                                No documentation available
                                                                  T
                                                                  Stream.PipelineDestination
                                                                  No documentation available
                                                                    T
                                                                    Stream.PipelinePromise
                                                                    No documentation available
                                                                      T
                                                                      Stream.PipelineSource
                                                                      No documentation available
                                                                        T
                                                                        Stream.PipelineSourceFunction
                                                                        No documentation available
                                                                          T
                                                                          Stream.PipelineTransform
                                                                          No documentation available
                                                                            T
                                                                            Stream.PipelineTransformSource
                                                                            No documentation available
                                                                              T
                                                                              Stream.TransformCallback
                                                                              No documentation available