Stream to Array
Concatenate a readable stream's data into a single array.
You may also be interested in:
- raw-body for strings
API
var toArray =
toArray([stream], [callback(err, arr)])
Returns all the data objects in an array. This is useful for streams in object mode if you want to just use an array.
var stream =
If stream
is not defined, it is assumed that this
is a stream.
var stream = streamtoArray = toArraystream
If callback
is not defined, then it returns a promise.
If you want to return a buffer, just use Buffer.concat(arr)