New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

qemitter

Package Overview
Dependencies
Maintainers
5
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qemitter

Node.js event emitter with promises support

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-91.07%
Maintainers
5
Weekly downloads
 
Created
Source

QEmitter

Node.js event emitter with promises support.

Node.js builtin EventEmmiter class executes all handlers synchronously without waiting for completion of any async operations that may happen inside.

QEmitter is the subclass of EventEmmiter which adds ability to return a promise from event handler and wait until it resolved. Just use emitAndWait instead of emit:

var emitter = new QEmitter();
emitter.on('event', function() {
    return Q.delay(1000);
});

emmiter.emitAndWait('event')
    .then(function() {
        console.log('All handlers finished');
    });

emitAndWait returns Q promise.

utils

passthroughEvent(from, to, event)

Passes event from from to to.

event can be an array of events.

Keywords

FAQs

Package last updated on 13 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc