Reads all remaining data from a stream and returns it as one buffer.
import fs from 'fs';const stream = fs.createReadStream('/path/to/my/file.json');const allData: Buffer = await readStream(stream);
The promise with the buffer.
The stream.
Optional
The custom encoding, if each chunk is a string.
Generated using TypeDoc
Reads all remaining data from a stream and returns it as one buffer.
Example
Returns
The promise with the buffer.