logger.js 279 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(); var url = 'http:mylogger.io/log'; function log(message) { // Send an HTTP request console.log(message); emitter.emit('messageLogged', {id: 1, url: 'http://' }); } module.exports = log;