promise2stream
Transform ES2015 Promise to Stream - specifically, Transform Stream using through2. Works in object mode by default, but you can pass options directly to the through2 package.
Install
npm i promise2stream --save
Usage
For more use-cases see the tests
const promise2stream =
promise2stream
Transform a Promise
val
to transform stream.
Params
val
{Promise}: Some promise.opts
{Object}: Options passed directly to through2.returns
{Stream}
Example
var promise2stream = var promise = Promise var stream = stream // or access the promisestreampromise // rejected promise fires `error` eventvar rejectedPromise = Promisevar stream = stream
Related
- always-stream: Create stream from any value - function, array, string, buffer, promise, number,… more | homepage
- callback2stream: Transform sync, async or generator function to Stream. Correctly handle errors. homepage
- limon: The pluggable JavaScript lexer. Limon = Lemon. | homepage
- postcss: Tool for transforming styles with JS plugins | homepage
- posthtml: HTML/XML processor | homepage
- postjson: Transforming JSON with plugins. | homepage
- promise2thunk: Convert (transform) promise to thunk, just like was in co@3 | homepage
- stream-from-promise: Create streams from promises | homepage
- stream-to-promise: Convert streams (readable or writable) to promises | homepage
- through2: A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise | homepage
- thunk2promise: Transform or convert thunk to Bluebird Promise. | homepage
- value2stream: Transform any value to stream. Create stream from any value - string,… more | homepage
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.