events-promise

1.0.0 • Public • Published

*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

Package Sidebar

Install

npm i events-promise

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

4.65 kB

Total Files

7

Last publish

Collaborators

  • medikoo