title: Sharing event across modules
body: <p>For simplicity I have create some small files to test out the idea. Basically i'm looking for a way to emit and event on a module then have that picked up back in the main file for example</p>
  
  <p>This is the main file called to run the app</p>
  
  <p><strong>main.js</strong></p>
  
  <pre><code>var test = require('./test')
  var emitter = require('./emitter')
  var emit = new emitter()
  
  emit.on('response', function(data) {
      console.log(data)
  })
  </code></pre>
  
  <p>This is where the event is fired</p>
  
  <p><strong>fire.js</strong></p>
  
  <pre><code>var emitter = require('./emitter')
  var emit = new emitter
  
  var Test = function() {
      emit.sendEvent('response', 'test')
  }
  
  
  module.exports = Test
  </code></pre>
  
  <p>Here is the module created to handle the firing of events for the application</p>
  
  <p><strong>emitter.js</strong></p>
  
  <pre><code>var util = require('util')
  var eventEmitter = require('events').EventEmitter
  
  function Event () {
      eventEmitter.call(this)
  }
  
  util.inherits(Event, eventEmitter)
  
  Event.prototype.sendEvent = function(type, data) {
      this.emit(type, data)
  }
  
  module.exports = Event
  </code></pre>
  
  <p>As can be seen in the <code>emitter.js</code> I have it setup to be able to emit any custom type including data parsed. </p>
  
  <p>I cannot seem to pick this up in the initial <code>main.js</code> file. However if I place <code>emit.sendEvent('response', 'banana')</code> in the <code>main.js</code> at the bottom of the file it is picked up by the listener above. This would indicate that my <code>emitter.js</code> is working correctly.</p>
  
  <p>Any ideas as to why the event emitted in <code>fire.js</code> isn't being picked up would be great.  </p>