Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

async-emitter

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-emitter

Non-blocking event emitter

  • 1.5.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
478
decreased by-44.42%
Maintainers
1
Weekly downloads
 
Created
Source

Emitter build status NPM version

A non-blocking event emitter. Non-blocking as in "if I call emitter.emit(), the emission of events to their handlers won't block".

Given the nature of "events", one would think event emission is always asynchronous. Looking at most implementations; that's not the case. This fixes it by running each handler with setTimeout/nextTick.

Install with npm

$ npm install async-emitter

Install with bower

$ bower install emitter

API

Class Properties

  • function Emitter.nextTick

  • boolean Emitter.warn

Instance Methods

  • {Emitter} emitter.on( string event, function|object handler )

  • {Emitter} emitter.once( string event, function|object handler )

  • {Boolean} emitter.emit( string event, [arg1], [arg2], [...] )

  • {Boolean} emitter.emitSync( string event, [arg1], [arg2], [...] )

  • {Emitter} emitter.removeListener( string event, function|object handler )

  • {Emitter} emitter.removeAllListeners( string [event] )

  • {Emitter} emitter.setMaxListeners( number value )

  • {Array} emitter.listeners( string event )

Keywords

FAQs

Package last updated on 16 Nov 2013

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