events-emitter-lighter
1.0.0 • Public • Published
npm i -S events-emitter-lighter
const Events = require('events-emitter-lighter')
const myEvent = new Events()
function log (...args) {
console.log(args)
}
myEvent.on('msg', log)
myEvent.emit('msg', 'hello', 'node') // ['hello', 'node']
myEvent.remove('msg', log)
myEvent.once('greet', () => { console.log('hello world') })
myEvent.emit('greet') // 'hello world'
Dependencies (0)
Dev Dependencies (0)
Package Sidebar
Install
npm i events-emitter-lighter
Weekly Downloads