1.0.0 • Published 5 years ago

stream-promise-2 v1.0.0

Weekly downloads
4
License
ISC
Repository
github
Last release
5 years ago

*nix build status Windows build status Tests coverage Transpilation status

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