UNPKG

streaming

Version:

Transforms and other streaming helpers

14 lines (10 loc) 436 B
import { Readable } from 'stream'; /** Read a stream to the end, storing all chunks in an array. For example, to read all STDIN: streaming.readToEnd(process.stdin, (err, chunks) => { if (err) throw err; const input = chunks.join(''); console.log('Got input of length: ' + input.length); }); */ export declare function readToEnd(stream: Readable, callback: (error: Error, chunks?: any[]) => void): Readable;