Promised Lifestream
Creating promisified stream pipeline for Node.js
Feature
- Streams are pipelined and it resolves when last stream have finished.
- If an error occurred at any stream, it rejects with the error.
- If last stream is Readable or Transform, it appends auto-generated writer to streams.
- Last stream must raise
finish
event.process.stdout
doesn't raise it.
Install
$ npm install -save promised-lifestream
How to use
PromisedLifestream(streams, [options])
streams
<Array<Stream>>
streams composes pipeline. The first stream must be Readable. The second and any later stream must be Writable. The last stream can be Transform.options
<Object>
needResult
<Boolean>
Whether the last stream result is resolved or not. Defaults to false
Example
'use strict'; const fs = ;const stream = ;const es = ;const PromisedLifestream = ; var i = 0; ;
Get last result
;