1.0.0 • Published 5 years ago

events-promise v1.0.0

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

*nix build status Windows build status Tests coverage Transpilation status npm version

events-promise

Promise that's a also a Node.js EventEmitter

Useful when we want to serve both EventEmitter (e.g. Stream) instance and Promise instance as one object

Installation

npm install events-promise

Usage

const EventsPromise = require("events-promise");

const eventsPromise = new EventsPromise((resolve, reject) => {
	...
});

eventsPromise.addListener("someevent", event => {
	...
});
eventsPromise.emit("someevent", { ... });

Tests

npm test