This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

evn

0.0.1 • Public • Published

evn

Manage events in JavaScript

npm npm

Installation

npm install --save evn

API

evn.add(id, callback, scope)

Add a new event listener.

id

A string withe the event ID.

callback

The function that will be executed when the event is executed.

scope

The value of this where the callback will be executed.

evn.send(id[, args])

Emit an event.

id

The event ID that will be executed.

args (optionally)

Arguments for the callback.

Example

//Import dependencies
var evn = require('evn');
 
//Add a new event
evn.add('say_hello', function(name){ console.log('Hello ' + name + '!!'); });
 
//Call the event
evn.send('say_hello', 'Susan'); // -> Hello Susan!!

License

© MIT LICENSE

Readme

Keywords

Package Sidebar

Install

npm i evn

Weekly Downloads

7

Version

0.0.1

License

MIT

Last publish

Collaborators

  • jmjuanes