{"size": 521, "ext": "js", "max_stars_repo_path": "_/Volume2/Section1/Section1.3/ouremitter.js", "max_stars_repo_name": "paullewallencom/node-978-1-7864-6474-3", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "_/Volume2/Section1/Section1.3/ouremitter.js", "max_issues_repo_name": "paullewallencom/node-978-1-7864-6474-3", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "_/Volume2/Section1/Section1.3/ouremitter.js", "max_forks_repo_name": "paullewallencom/node-978-1-7864-6474-3", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.6818181818, "max_line_length": 79, "alphanum_fraction": 0.5854126679}
const EventEmitter = require('events');

module.exports = class OurEmitter extends EventEmitter{
  constructor(){
    super();
    this.intervalId = setInterval(() => {
      if(this.intervalId === null) this.emit('error', new Error('No timeout'));

      this.emit('second', Date.now())
    }, 1000);

    setTimeout(() => {
      this.emit('error', new Error('This is arbitrary'));
    }, 5000);

    setTimeout(() => {
      this.emit('end', 'We are done');
      clearInterval(this.intervalId);
    }, 12000);
  }
};
