Read stream to buffer or string
$ npm install --save read-all-stream
var read = ;var stream = fs;;;
read(stream, [options], [callback])
If callback is omitted, Promise will be returned.
Event emitter, which
data events will be consumed.
If type of
string, then it will be used as encoding.
If type is
Object, then next options are available:
Encoding to be used on
toString of the data. If null, the body is returned as a Buffer.
Will be called after stream is read.
Error object (if
error event happens).
The data in stream.
MIT © Vsevolod Strukchinsky