sachinbhatnagar / ex-nodejs-event-emitter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Node.js - Event Emitter Demo

This simple example demonstrates the use of the event emitter interface in Node.js. The emitter.js file uses the emitter to emit a random number designated as stock-price every few seconds. This is then intercepted in the app.js file using the .on() event listener and rendered on the console. This way, the event emitter interface enables facilitates a messaging system between modules in Node.js and is used extensively within the asynchronous side of Node.

INSTRUCTIONS

  1. Type node app.js to kick start the application.
  2. You'll see a random stock price amount display every 3 seconds on the console.

Sachin Bhatnagar | sachin@knowledgehut.co

About


Languages

Language:JavaScript 100.0%