title: When to use eventEmitter in Node js?
body: <p>I am learning new concept in node js that is event but i could not find where i should use this,I want any real scenario I could not find any article or blog on this.</p>
  
  <pre><code>var events = require('events');
  var eventEmitter = new events.EventEmitter();
  
  //Create an event handler:
  var myEventHandler = function () {
    console.log('I hear a scream!');
  }
  
  //Assign the event handler to an event:
  eventEmitter.on('scream', myEventHandler);
  eventEmitter.on('test', function(){
      console.log("Testing event");
  });
  
  //Fire the 'scream' event:
  eventEmitter.emit('scream');
  eventEmitter.emit('scream');
  eventEmitter.emit('test');
  </code></pre>
  
  <p>I can achive same thing by simple call function like <code>myEvenHandler()</code>?</p>