get-stream

  • Version 6.0.1
  • Published
  • 12.2 kB
  • No dependencies
  • MIT license

Install

npm i get-stream
yarn add get-stream
pnpm add get-stream

Overview

Get a stream as a string, buffer, or array

Index

Variables

variable getStream

const getStream: {
(stream: Stream, options?: getStream.OptionsWithEncoding): Promise<string>;
buffer(stream: Stream, options?: getStream.Options): Promise<Buffer>;
array<StreamObjectModeType>(
stream: Stream,
options?: getStream.Options
): Promise<StreamObjectModeType[]>;
array(
stream: Stream,
options: getStream.OptionsWithEncoding<'buffer'>
): Promise<Buffer[]>;
array(
stream: Stream,
options: getStream.OptionsWithEncoding<BufferEncoding>
): Promise<string[]>;
MaxBufferError: typeof MaxBufferErrorClass;
};

    Interfaces

    interface Options

    interface Options {}

      property maxBuffer

      readonly maxBuffer?: number;
      • Maximum length of the returned string. If it exceeds this value before the stream ends, the promise will be rejected with a MaxBufferError error.

        Infinity

      interface OptionsWithEncoding

      interface OptionsWithEncoding<EncodingType = BufferEncoding> extends Options {}

        property encoding

        readonly encoding?: EncodingType;
        • [Encoding](https://nodejs.org/api/buffer.html#buffer_buffer) of the incoming stream.

          'utf8'

        Type Aliases

        type MaxBufferError

        type MaxBufferError = MaxBufferErrorClass;

          Package Files (1)

          Dependencies (0)

          No dependencies.

          Dev Dependencies (5)

          Peer Dependencies (0)

          No peer dependencies.

          Badge

          To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

          You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/get-stream.

          • Markdown
            [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/get-stream)
          • HTML
            <a href="https://www.jsdocs.io/package/get-stream"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>