0.0.2 • Published 6 years ago

3vent v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

MinEvent

Very light EventEmitter-like functionality for Node.js

Provides an interface that is similar to an EventEmitter.

$ npm i --save 3vent

Example

const EventEmitter = require('3vent')

class Dude extends EventEmitter {
  constructor () {
    super()
  }

  test (name) {
    this.emit('msg', name)
  }
}

const bob = new Dude()
bob.on('msg', msg => console.log('message:', msg))

bob.test('sup') // logs "message: sup"