app.js 238 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 const EventEmitter = require('events'); const emitter = new EventEmitter(); // Register a listener emitter.on('messageLogged', (arg) => { console.log('Listener called',arg); }); const log = require('./logger'); log('message');