stream-promise-2
v1.0.0
Published
Promise that shares Node.js Stream interface
Downloads
4
Maintainers
Readme
stream-promise
Promise that's a also a Node.js Stream
Useful when we want to serve both a Stream
instance and a Promise
instance as one object
Installation
npm install stream-promise-2
Usage
const StreamPromise = require("stream-promise-2");
const streamPromise = new StreamPromise((resolve, reject) => {
...
});
streamPromise.addListener("someevent", event => {
...
});
streamPromise.emit("someevent", { ... });
stream.pipe(otherStream);
Tests
npm test