async-concat-stream
Asynchronous concat-stream. Writable stream that concatenates string or binary data and returns a promise that resolves with the result.
Usage
const concat = require('async-concat-stream')
concat(opts = {})
Creates a writable concat-stream. The promise
property of the returned stream will be resolved when all of the data has been written to the stream.
Parameters:
opts
- concat-stream options
Returns: Writable
- writable stream from concat-stream with promise
property
Usage:
let writable = concat()
readable.pipe(writable)
let data = await writable.promise
concat.from(readable, opts = {})
Convenience method to read from the specified readable stream. Also handles errors from the readable stream.
Parameters:
readable
- Readable
, The readable streamopts
- concat-stream options
Returns: Promise
- resolves with the data from concat-stream
Usage:
let data = await concat.from(readable)
Why make this when there are ~2 others?
I like to avoid promise modules and unnecessarily adding stuff to and hybridizing promises.
License
MIT