mefirst

Attach an event listener to run first

node-mefirst

Attach an event listener to run first.

var EventEmitter = require('events').EventEmitter
  , emitter = new EventEmitter
  , mefirst = require('mefirst')
 
emitter.on('something', function() {
  console.log('i ran');
});
 
mefirst(emitter, 'something', function() {
  console.log('i ran first!');
});
 
emitter.emit('something');
i ran first!
i ran

MIT