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

async-eventer

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-eventer

A tiny library with asynchronous Promise-based implementation of events dispatching and handling

  • 1.1.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

Async eventer Travis CI

A tiny library with asynchronous Promise-based implementation of events dispatching and handling.

This library works in Node and in Browser environments (UMD) and is optimized for very small size (under 1000 bytes raw, under 500 bytes gz).

How to install

npm install async-eventer

How to use

Node.js:

var Eventer = require('async-eventer')

var instance = Eventer();
// Do stuff

Browser:

requirejs(['async-eventer'], function (Eventer) {
    var instance = Eventer();
    // Do stuff
})

API

Eventer.on(event: string, callback: Function) : Eventer

Register event handler.

Eventer.once(event: string, callback: Function) : Eventer

Register one-time event handler (just on() + off() under the hood).

Eventer.off(event: string[, callback: Function]) : Eventer

Unregister event handler.

Eventer.fire(event: string, ...param) : Promise

Dispatch an event with arbitrary number of parameters.

tests/index.ls contains usage examples.

Contribution

Feel free to create issues and send pull requests (for big changes create an issue first and link it from the PR), they are highly appreciated!

When reading LiveScript code make sure to configure 1 tab to be 4 spaces (GitHub uses 8 by default), otherwise code might be hard to read.

License

Free Public License 1.0.0 / Zero Clause BSD License

https://opensource.org/licenses/FPL-1.0.0

https://tldrlegal.com/license/bsd-0-clause-license

Keywords

FAQs

Package last updated on 23 May 2018

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