const EventEmitter = require('events')
const customEmitter = new EventEmitter()
customEmitter.on('response', (name, id)=>{
console.log(`data received ${name}, ${id}`)
})
customEmitter.on('response', ()=>{
console.log('some other logic')
})
customEmitter.emit('response', 'john', 34)
주의⛔ 반드시 emit
보다 on
이 위로 올라가 있어야 함. 즉 이벤트보다 먼저 listening
하고 있어야 한다.