1const events = require('events');
2
3const eventEmitter = new events.EventEmitter();
4
5eventEmitter.on('scream', function() {
6 console.log("Screaming");
7});
8
9eventEmitter.on('scream', function(name) {
10 console.log(name+" is screaming");
11});
12
13eventEmitter.emit('scream', 'Bob');
14