energy

simple cross-platform event emitter based on EventEmitter

API

Create an emitter instance

const energy = require("energy")
const emitter = energy()

Or use new if you prefer. Either way works :)

const energy = require("energy")
const emitter = new energy

Methods

Parameters

emitter.on(event, listener)

emitter.off(event?, listener?, quota?)

emitter.emit(event, ...args)

emitter.once(event, listener)

emitter.clone()

emitter.listeners(event)

emitter.init()

emitter.to(target)

energy.to(target)

Compatibility

Works in node and in any browser. Tested in node, Chrome, FF, Opera, IE8