make-emitter
An event emitter constructor factory. Save ~3 lines of code with each use!
api
function makeEmitter([object methods])
require('make-emitter')
returns the function makeEmitter
The function make-emitter
returns a constructor function for a new object which inherits
from EventEmitter. Optionall you can supply a hash of methods which will be added to the prototype of
the new Constructor.
example - old and busted:
var EventEmitter = EventEmitter;var util = ; var { EventEmitter;}; util; CustomEmitterprototype { this;};
example - with make-emitter;
var emitter = ;var CustomEmitter = ;
incredible.
install
npm install make-emitter
test
npm test
license
MIT