Represents a readable stream that provides a way to read data asynchronously.

interface IReadableStream {
    close(): Promise<void>;
    read(): Promise<null | Uint8Array>;
}

Methods

Methods

  • Closes the stream and releases any resources associated with it.

    Returns Promise<void>

    A promise that resolves when the stream is successfully closed.

  • Reads the next chunk of data from the stream.

    Returns Promise<null | Uint8Array>

    A promise that resolves to a Uint8Array containing the data read from the stream, or null if the end of the stream has been reached.