Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @aws-sdk/chunked-stream-reader-node

@aws-sdk/chunked-stream-reader-node

NPM version NPM downloads

Exports a streamReader function that accepts a readable stream, a function to call on each chunk, and a chunk size in bytes to buffer interally before calling the supplied function.

This package is meant for the AWS SDK for JavaScript to enable reading a stream with consistent chunk sizes.

An internal package

Usage

You probably shouldn't, at least directly.

Index

Functions

mergeUint8Arrays

  • mergeUint8Arrays(a: Uint8Array, b: Uint8Array): Uint8Array

streamReader

  • streamReader(stream: Readable, onChunk: (chunk: Uint8Array) => void, chunkSize?: number): Promise<void>
  • Parameters

    • stream: Readable
    • onChunk: (chunk: Uint8Array) => void
        • (chunk: Uint8Array): void
        • Parameters

          • chunk: Uint8Array

          Returns void

    • Default value chunkSize: number = 1048576

    Returns Promise<void>