Nodejs How To?
nodejs.org
Where do we use it?
●   Yahoo Proxy Feed
●   XML Api
●   IP2Country Service
●   IP Spam Cop
●   Skitto
●   RTB Serving
We Started with an evil
var http = require('http');
http.createServer(function (req, res) {
 res.writeHead(200, {'Content-Type': 'text/plain'});
 res.end('Hello World ');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
DON'T CALL ME A WEBSERVER
Why??
Coz I Can even answer what 1+1 is :P
I'm a platform with event-driven, non-blocking I/O for N/W application
development



Using Node as a Server that responds to HTTP requests is a use case :)
ARCHITECTURE
LOOP IS MY LIFE
I have only one worker [Single Threaded]

He runs in an Event Loop
  ● A Loop over a queue of events to be processed
  ● Event Loop !== setInterval

He serves the events via callbacks and Don't dare to block him, then
I will the shift to state of coma ;)
AM I ASYNC?
Ya people do believe so ;)

Scenarios
  ● I/O
  ● setInterval
  ● setTimeout
  ● process.nextTick
Quick Demo
Programming in Node
Prerequisites

  ●   Deeper understanding of javascript closures and this [We take
      it for granted :P]
  ●   Node's async behaviour
  ●   Node's module system & npm [He is the one :)]
Nodejs Module System


 ●   Inherits Common JS module system
 ●   All you require is the cached module.exports object
 ●   You have a lots of options to locate
npm

●   npm !== Node Package Manager [npm is not an acronym
    (ninaa) - may be ;)]
●   If maven is for java then npm is for node
●   npm + package.json + modules The way to write node app :)
Is coding asynchronous way hard?
We had no choice and we were left in the state below :P
Patterns and Antipatterns??
PS: All Javascript Patterns and Antipatterns apply ;)
Debugging + Monitoring :(
Trust us, It is harder than developing an App :)
Overview



           Questions !!!!!!

Node ppt

  • 1.
  • 2.
    Where do weuse it? ● Yahoo Proxy Feed ● XML Api ● IP2Country Service ● IP Spam Cop ● Skitto ● RTB Serving
  • 3.
    We Started withan evil var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World '); }).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/');
  • 4.
    DON'T CALL MEA WEBSERVER Why?? Coz I Can even answer what 1+1 is :P I'm a platform with event-driven, non-blocking I/O for N/W application development Using Node as a Server that responds to HTTP requests is a use case :)
  • 5.
  • 6.
    LOOP IS MYLIFE I have only one worker [Single Threaded] He runs in an Event Loop ● A Loop over a queue of events to be processed ● Event Loop !== setInterval He serves the events via callbacks and Don't dare to block him, then I will the shift to state of coma ;)
  • 7.
    AM I ASYNC? Yapeople do believe so ;) Scenarios ● I/O ● setInterval ● setTimeout ● process.nextTick
  • 8.
  • 9.
    Programming in Node Prerequisites ● Deeper understanding of javascript closures and this [We take it for granted :P] ● Node's async behaviour ● Node's module system & npm [He is the one :)]
  • 10.
    Nodejs Module System ● Inherits Common JS module system ● All you require is the cached module.exports object ● You have a lots of options to locate
  • 11.
    npm ● npm !== Node Package Manager [npm is not an acronym (ninaa) - may be ;)] ● If maven is for java then npm is for node ● npm + package.json + modules The way to write node app :)
  • 12.
    Is coding asynchronousway hard? We had no choice and we were left in the state below :P
  • 13.
    Patterns and Antipatterns?? PS:All Javascript Patterns and Antipatterns apply ;)
  • 14.
    Debugging + Monitoring:( Trust us, It is harder than developing an App :)
  • 15.
    Overview Questions !!!!!!