Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 348 Bytes

section48.1.md

File metadata and controls

17 lines (13 loc) · 348 Bytes

Section 48.1: The Node.js philosophy

  • a - "Small is beautiful"
  • b - "Make each program do one thing well."
let events = require('events');
let eventEmitter = new events.EventEmitter();

let ringBell = function ringBell()
{
  console.log('tring tring tring');
}

eventEmitter.on('doorOpen', ringBell);
eventEmitter.emit('doorOpen');