Event emitter Install npm install mevent --save Use const hub = require('mevent')() hub.on('ping', arg => console.log(arg)) hub.emit('ping', 'hi!')