SlideShare a Scribd company logo
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 !!!!!!

More Related Content

What's hot

What's hot (20)

Node.js Basics
Node.js Basics Node.js Basics
Node.js Basics
 
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBasic Concept of Node.js & NPM
Basic Concept of Node.js & NPM
 
Express js
Express jsExpress js
Express js
 
Nodejs Explained with Examples
Nodejs Explained with ExamplesNodejs Explained with Examples
Nodejs Explained with Examples
 
Introduction Node.js
Introduction Node.jsIntroduction Node.js
Introduction Node.js
 
An Overview on Nuxt.js
An Overview on Nuxt.jsAn Overview on Nuxt.js
An Overview on Nuxt.js
 
Ngrx slides
Ngrx slidesNgrx slides
Ngrx slides
 
Node js for beginners
Node js for beginnersNode js for beginners
Node js for beginners
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Node js
Node jsNode js
Node js
 
gRPC Overview
gRPC OverviewgRPC Overview
gRPC Overview
 
Node.js
Node.jsNode.js
Node.js
 
Basics of React Hooks.pptx.pdf
Basics of React Hooks.pptx.pdfBasics of React Hooks.pptx.pdf
Basics of React Hooks.pptx.pdf
 
ORM: Object-relational mapping
ORM: Object-relational mappingORM: Object-relational mapping
ORM: Object-relational mapping
 
ReactJS presentation.pptx
ReactJS presentation.pptxReactJS presentation.pptx
ReactJS presentation.pptx
 
React & Redux
React & ReduxReact & Redux
React & Redux
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
 
An Intro into webpack
An Intro into webpackAn Intro into webpack
An Intro into webpack
 
NEXT.JS
NEXT.JSNEXT.JS
NEXT.JS
 
Kotlin for Android Development
Kotlin for Android DevelopmentKotlin for Android Development
Kotlin for Android Development
 

Similar to Node ppt

Node.js for Rubists
Node.js for RubistsNode.js for Rubists
Node.js for Rubists
Sagiv Ofek
 
Integrating Node.js with PHP
Integrating Node.js with PHPIntegrating Node.js with PHP
Integrating Node.js with PHP
Lee Boynton
 

Similar to Node ppt (20)

Nodejs web service for starters
Nodejs web service for startersNodejs web service for starters
Nodejs web service for starters
 
Nodejs
NodejsNodejs
Nodejs
 
An overview of node.js
An overview of node.jsAn overview of node.js
An overview of node.js
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Node.js for Rubists
Node.js for RubistsNode.js for Rubists
Node.js for Rubists
 
Shall we play a game?
Shall we play a game?Shall we play a game?
Shall we play a game?
 
Node.js streams talk
Node.js streams talkNode.js streams talk
Node.js streams talk
 
OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshop
 
SWT Tech Sharing: Node.js + Redis
SWT Tech Sharing: Node.js + RedisSWT Tech Sharing: Node.js + Redis
SWT Tech Sharing: Node.js + Redis
 
Node.js
Node.jsNode.js
Node.js
 
Nodejs
NodejsNodejs
Nodejs
 
"Node.js vs workers — A comparison of two JavaScript runtimes", James M Snell
"Node.js vs workers — A comparison of two JavaScript runtimes", James M Snell"Node.js vs workers — A comparison of two JavaScript runtimes", James M Snell
"Node.js vs workers — A comparison of two JavaScript runtimes", James M Snell
 
Why and How You Should Move from PHP to Node.js
Why and How You Should Move from PHP to Node.jsWhy and How You Should Move from PHP to Node.js
Why and How You Should Move from PHP to Node.js
 
Integrating Node.js with PHP
Integrating Node.js with PHPIntegrating Node.js with PHP
Integrating Node.js with PHP
 
Asynchronous job queues with python-rq
Asynchronous job queues with python-rqAsynchronous job queues with python-rq
Asynchronous job queues with python-rq
 
Node
NodeNode
Node
 
Node.js essentials
 Node.js essentials Node.js essentials
Node.js essentials
 
Nodejs server lesson 3
 Nodejs server lesson 3 Nodejs server lesson 3
Nodejs server lesson 3
 
Swoole Meetup AFUP¨Montpellier 27/01/2021
Swoole   Meetup  AFUP¨Montpellier 27/01/2021Swoole   Meetup  AFUP¨Montpellier 27/01/2021
Swoole Meetup AFUP¨Montpellier 27/01/2021
 
Play Framework
Play FrameworkPlay Framework
Play Framework
 

Recently uploaded

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Recently uploaded (20)

AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG Evaluation
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
The architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdfThe architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdf
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Server-Driven User Interface (SDUI) at Priceline
Server-Driven User Interface (SDUI) at PricelineServer-Driven User Interface (SDUI) at Priceline
Server-Driven User Interface (SDUI) at Priceline
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
Connecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKConnecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAK
 

Node ppt

  • 2. Where do we use it? ● Yahoo Proxy Feed ● XML Api ● IP2Country Service ● IP Spam Cop ● Skitto ● RTB Serving
  • 3. 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/');
  • 4. 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 :)
  • 6. 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 ;)
  • 7. AM I ASYNC? Ya people do believe so ;) Scenarios ● I/O ● setInterval ● setTimeout ● process.nextTick
  • 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 asynchronous way 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 !!!!!!