ºÝºÝߣ

ºÝºÝߣShare 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 (20)

NodeJS for Beginner
NodeJS for BeginnerNodeJS for Beginner
NodeJS for Beginner
Apaichon Punopas
?
Express js
Express jsExpress js
Express js
Manav Prasad
?
Vue.js
Vue.jsVue.js
Vue.js
Jadson Santos
?
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Rob O'Doherty
?
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
Akshay Mathur
?
Node js Introduction
Node js IntroductionNode js Introduction
Node js Introduction
sanskriti agarwal
?
Use Node.js to create a REST API
Use Node.js to create a REST APIUse Node.js to create a REST API
Use Node.js to create a REST API
Fabien Vauchelles
?
Understanding react hooks
Understanding react hooksUnderstanding react hooks
Understanding react hooks
Maulik Shah
?
NodeJS - Server Side JS
NodeJS - Server Side JS NodeJS - Server Side JS
NodeJS - Server Side JS
Ganesh Kondal
?
Node js
Node jsNode js
Node js
Fatih ?im?ek
?
Asynchronous JavaScript Programming with Callbacks & Promises
Asynchronous JavaScript Programming with Callbacks & PromisesAsynchronous JavaScript Programming with Callbacks & Promises
Asynchronous JavaScript Programming with Callbacks & Promises
H¨´ng Nguy?n Huy
?
Understanding React hooks | Walkingtree Technologies
Understanding React hooks | Walkingtree TechnologiesUnderstanding React hooks | Walkingtree Technologies
Understanding React hooks | Walkingtree Technologies
Walking Tree Technologies
?
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBasic Concept of Node.js & NPM
Basic Concept of Node.js & NPM
Bhargav Anadkat
?
Node JS Crash Course
Node JS Crash CourseNode JS Crash Course
Node JS Crash Course
Haim Michael
?
React Native
React NativeReact Native
React Native
Craig Jolicoeur
?
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation
ºé Åô·¢
?
Understanding react hooks
Understanding react hooksUnderstanding react hooks
Understanding react hooks
Samundra khatri
?
Express JS
Express JSExpress JS
Express JS
Designveloper
?
React Context API
React Context APIReact Context API
React Context API
NodeXperts
?
Intro to vue.js
Intro to vue.jsIntro to vue.js
Intro to vue.js
TechMagic
?

Similar to Node ppt (20)

Nodejs web service for starters
Nodejs web service for startersNodejs web service for starters
Nodejs web service for starters
Bruce Li
?
Nodejs
NodejsNodejs
Nodejs
Vinod Kumar Marupu
?
An overview of node.js
An overview of node.jsAn overview of node.js
An overview of node.js
valuebound
?
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Setyo Nugroho
?
Node.js for Rubists
Node.js for RubistsNode.js for Rubists
Node.js for Rubists
Sagiv Ofek
?
Shall we play a game?
Shall we play a game?Shall we play a game?
Shall we play a game?
Maciej Lasyk
?
Node.js streams talk
Node.js streams talkNode.js streams talk
Node.js streams talk
zladuric
?
Node js for beginners
Node js for beginnersNode js for beginners
Node js for beginners
Arjun Sreekumar
?
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
leffen
?
SWT Tech Sharing: Node.js + Redis
SWT Tech Sharing: Node.js + RedisSWT Tech Sharing: Node.js + Redis
SWT Tech Sharing: Node.js + Redis
Infinity Levels Studio
?
Node.js
Node.jsNode.js
Node.js
EU Edge
?
Nodejs
NodejsNodejs
Nodejs
Mahmoud Atef Abdelsamie
?
"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
Fwdays
?
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
Brainhub
?
Integrating Node.js with PHP
Integrating Node.js with PHPIntegrating Node.js with PHP
Integrating Node.js with PHP
Lee Boynton
?
Asynchronous job queues with python-rq
Asynchronous job queues with python-rqAsynchronous job queues with python-rq
Asynchronous job queues with python-rq
Ashish Acharya
?
Node
NodeNode
Node
Ankit Chawla
?
Node.js essentials
 Node.js essentials Node.js essentials
Node.js essentials
Bedis ElAch¨¨che
?
Nodejs server lesson 3
 Nodejs server lesson 3 Nodejs server lesson 3
Nodejs server lesson 3
SamuelAdetunji2
?
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
Julien Vinber
?
Nodejs web service for starters
Nodejs web service for startersNodejs web service for starters
Nodejs web service for starters
Bruce Li
?
An overview of node.js
An overview of node.jsAn overview of node.js
An overview of node.js
valuebound
?
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Setyo Nugroho
?
Node.js for Rubists
Node.js for RubistsNode.js for Rubists
Node.js for Rubists
Sagiv Ofek
?
Shall we play a game?
Shall we play a game?Shall we play a game?
Shall we play a game?
Maciej Lasyk
?
Node.js streams talk
Node.js streams talkNode.js streams talk
Node.js streams talk
zladuric
?
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
leffen
?
"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
Fwdays
?
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
Brainhub
?
Integrating Node.js with PHP
Integrating Node.js with PHPIntegrating Node.js with PHP
Integrating Node.js with PHP
Lee Boynton
?
Asynchronous job queues with python-rq
Asynchronous job queues with python-rqAsynchronous job queues with python-rq
Asynchronous job queues with python-rq
Ashish Acharya
?
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
Julien Vinber
?

Recently uploaded (20)

Digital twins as key enabler for innovation in IoT systems
Digital twins as key enabler for innovation in IoT systemsDigital twins as key enabler for innovation in IoT systems
Digital twins as key enabler for innovation in IoT systems
Daniel Lehner
?
Object Storage in ScyllaDB by Ran Regev, ScyllaDB
Object Storage in ScyllaDB by Ran Regev, ScyllaDBObject Storage in ScyllaDB by Ran Regev, ScyllaDB
Object Storage in ScyllaDB by Ran Regev, ScyllaDB
ScyllaDB
?
Global AI Bootcamp 2025 - Sydney - Model Agnostic AI Implementation
Global  AI Bootcamp 2025 - Sydney - Model Agnostic AI ImplementationGlobal  AI Bootcamp 2025 - Sydney - Model Agnostic AI Implementation
Global AI Bootcamp 2025 - Sydney - Model Agnostic AI Implementation
Anupam Ranku
?
[QUICK TALK] "Coaching 101: How to Identify and Develop Your Leadership Quali...
[QUICK TALK] "Coaching 101: How to Identify and Develop Your Leadership Quali...[QUICK TALK] "Coaching 101: How to Identify and Develop Your Leadership Quali...
[QUICK TALK] "Coaching 101: How to Identify and Develop Your Leadership Quali...
Fwdays
?
Redefining Efficiency in AI: The Impact of 1.58-bit LLMs on the Future of Com...
Redefining Efficiency in AI: The Impact of 1.58-bit LLMs on the Future of Com...Redefining Efficiency in AI: The Impact of 1.58-bit LLMs on the Future of Com...
Redefining Efficiency in AI: The Impact of 1.58-bit LLMs on the Future of Com...
Gregor Lyttek
?
A Dist Sys Programmer's Journey into AI by Piotr Sarna
A Dist Sys Programmer's Journey into AI by Piotr SarnaA Dist Sys Programmer's Journey into AI by Piotr Sarna
A Dist Sys Programmer's Journey into AI by Piotr Sarna
ScyllaDB
?
March Patch Tuesday
March Patch TuesdayMarch Patch Tuesday
March Patch Tuesday
Ivanti
?
High Availability: Lessons Learned by Paul Preuveneers
High Availability: Lessons Learned by Paul PreuveneersHigh Availability: Lessons Learned by Paul Preuveneers
High Availability: Lessons Learned by Paul Preuveneers
ScyllaDB
?
Vector Search with ScyllaDB by Szymon Wasik
Vector Search with ScyllaDB by Szymon WasikVector Search with ScyllaDB by Szymon Wasik
Vector Search with ScyllaDB by Szymon Wasik
ScyllaDB
?
TrustArc Webinar: How to Create a Privacy-First Culture
TrustArc Webinar: How to Create a Privacy-First CultureTrustArc Webinar: How to Create a Privacy-First Culture
TrustArc Webinar: How to Create a Privacy-First Culture
TrustArc
?
Migrating 50TB Data From a Home-Grown Database to ScyllaDB, Fast by Terence Liu
Migrating 50TB Data From a Home-Grown Database to ScyllaDB, Fast by Terence LiuMigrating 50TB Data From a Home-Grown Database to ScyllaDB, Fast by Terence Liu
Migrating 50TB Data From a Home-Grown Database to ScyllaDB, Fast by Terence Liu
ScyllaDB
?
The Memory Wall in AI - A Crisis We Must Solve
The Memory Wall in AI - A Crisis We Must SolveThe Memory Wall in AI - A Crisis We Must Solve
The Memory Wall in AI - A Crisis We Must Solve
AI Infra Forum
?
"Surfing the IT Waves: How Not to Drown in the Information Ocean", Serhii Nem...
"Surfing the IT Waves: How Not to Drown in the Information Ocean", Serhii Nem..."Surfing the IT Waves: How Not to Drown in the Information Ocean", Serhii Nem...
"Surfing the IT Waves: How Not to Drown in the Information Ocean", Serhii Nem...
Fwdays
?
AI and developer obsolescence - BCS 2025.pdf
AI and developer obsolescence - BCS 2025.pdfAI and developer obsolescence - BCS 2025.pdf
AI and developer obsolescence - BCS 2025.pdf
Seb Rose
?
Automated Minutes - Redefining Capturing & Creating Minutes
Automated Minutes - Redefining Capturing & Creating MinutesAutomated Minutes - Redefining Capturing & Creating Minutes
Automated Minutes - Redefining Capturing & Creating Minutes
OnBoard
?
UiPath Automation Developer Associate Training Series 2025 - Session 4
UiPath Automation Developer Associate Training Series 2025 - Session 4UiPath Automation Developer Associate Training Series 2025 - Session 4
UiPath Automation Developer Associate Training Series 2025 - Session 4
DianaGray10
?
Verbose AI: The Accessibility Challenge - CSUN 2025
Verbose AI: The Accessibility Challenge - CSUN 2025Verbose AI: The Accessibility Challenge - CSUN 2025
Verbose AI: The Accessibility Challenge - CSUN 2025
Ted Drake
?
CCleaner Professional Key with Crack [Latest New Version 2025]
CCleaner Professional Key with Crack [Latest New Version 2025]CCleaner Professional Key with Crack [Latest New Version 2025]
CCleaner Professional Key with Crack [Latest New Version 2025]
abidkhan77g77
?
Unified Observability - Alkin Tezuysal - FOSSASIA Summit March 2025 .pdf
Unified Observability - Alkin Tezuysal - FOSSASIA Summit  March 2025 .pdfUnified Observability - Alkin Tezuysal - FOSSASIA Summit  March 2025 .pdf
Unified Observability - Alkin Tezuysal - FOSSASIA Summit March 2025 .pdf
Alkin Tezuysal
?
Blending AI in Enterprise Architecture.pdf
Blending AI in Enterprise Architecture.pdfBlending AI in Enterprise Architecture.pdf
Blending AI in Enterprise Architecture.pdf
Calvin Hendryx-Parker
?
Digital twins as key enabler for innovation in IoT systems
Digital twins as key enabler for innovation in IoT systemsDigital twins as key enabler for innovation in IoT systems
Digital twins as key enabler for innovation in IoT systems
Daniel Lehner
?
Object Storage in ScyllaDB by Ran Regev, ScyllaDB
Object Storage in ScyllaDB by Ran Regev, ScyllaDBObject Storage in ScyllaDB by Ran Regev, ScyllaDB
Object Storage in ScyllaDB by Ran Regev, ScyllaDB
ScyllaDB
?
Global AI Bootcamp 2025 - Sydney - Model Agnostic AI Implementation
Global  AI Bootcamp 2025 - Sydney - Model Agnostic AI ImplementationGlobal  AI Bootcamp 2025 - Sydney - Model Agnostic AI Implementation
Global AI Bootcamp 2025 - Sydney - Model Agnostic AI Implementation
Anupam Ranku
?
[QUICK TALK] "Coaching 101: How to Identify and Develop Your Leadership Quali...
[QUICK TALK] "Coaching 101: How to Identify and Develop Your Leadership Quali...[QUICK TALK] "Coaching 101: How to Identify and Develop Your Leadership Quali...
[QUICK TALK] "Coaching 101: How to Identify and Develop Your Leadership Quali...
Fwdays
?
Redefining Efficiency in AI: The Impact of 1.58-bit LLMs on the Future of Com...
Redefining Efficiency in AI: The Impact of 1.58-bit LLMs on the Future of Com...Redefining Efficiency in AI: The Impact of 1.58-bit LLMs on the Future of Com...
Redefining Efficiency in AI: The Impact of 1.58-bit LLMs on the Future of Com...
Gregor Lyttek
?
A Dist Sys Programmer's Journey into AI by Piotr Sarna
A Dist Sys Programmer's Journey into AI by Piotr SarnaA Dist Sys Programmer's Journey into AI by Piotr Sarna
A Dist Sys Programmer's Journey into AI by Piotr Sarna
ScyllaDB
?
March Patch Tuesday
March Patch TuesdayMarch Patch Tuesday
March Patch Tuesday
Ivanti
?
High Availability: Lessons Learned by Paul Preuveneers
High Availability: Lessons Learned by Paul PreuveneersHigh Availability: Lessons Learned by Paul Preuveneers
High Availability: Lessons Learned by Paul Preuveneers
ScyllaDB
?
Vector Search with ScyllaDB by Szymon Wasik
Vector Search with ScyllaDB by Szymon WasikVector Search with ScyllaDB by Szymon Wasik
Vector Search with ScyllaDB by Szymon Wasik
ScyllaDB
?
TrustArc Webinar: How to Create a Privacy-First Culture
TrustArc Webinar: How to Create a Privacy-First CultureTrustArc Webinar: How to Create a Privacy-First Culture
TrustArc Webinar: How to Create a Privacy-First Culture
TrustArc
?
Migrating 50TB Data From a Home-Grown Database to ScyllaDB, Fast by Terence Liu
Migrating 50TB Data From a Home-Grown Database to ScyllaDB, Fast by Terence LiuMigrating 50TB Data From a Home-Grown Database to ScyllaDB, Fast by Terence Liu
Migrating 50TB Data From a Home-Grown Database to ScyllaDB, Fast by Terence Liu
ScyllaDB
?
The Memory Wall in AI - A Crisis We Must Solve
The Memory Wall in AI - A Crisis We Must SolveThe Memory Wall in AI - A Crisis We Must Solve
The Memory Wall in AI - A Crisis We Must Solve
AI Infra Forum
?
"Surfing the IT Waves: How Not to Drown in the Information Ocean", Serhii Nem...
"Surfing the IT Waves: How Not to Drown in the Information Ocean", Serhii Nem..."Surfing the IT Waves: How Not to Drown in the Information Ocean", Serhii Nem...
"Surfing the IT Waves: How Not to Drown in the Information Ocean", Serhii Nem...
Fwdays
?
AI and developer obsolescence - BCS 2025.pdf
AI and developer obsolescence - BCS 2025.pdfAI and developer obsolescence - BCS 2025.pdf
AI and developer obsolescence - BCS 2025.pdf
Seb Rose
?
Automated Minutes - Redefining Capturing & Creating Minutes
Automated Minutes - Redefining Capturing & Creating MinutesAutomated Minutes - Redefining Capturing & Creating Minutes
Automated Minutes - Redefining Capturing & Creating Minutes
OnBoard
?
UiPath Automation Developer Associate Training Series 2025 - Session 4
UiPath Automation Developer Associate Training Series 2025 - Session 4UiPath Automation Developer Associate Training Series 2025 - Session 4
UiPath Automation Developer Associate Training Series 2025 - Session 4
DianaGray10
?
Verbose AI: The Accessibility Challenge - CSUN 2025
Verbose AI: The Accessibility Challenge - CSUN 2025Verbose AI: The Accessibility Challenge - CSUN 2025
Verbose AI: The Accessibility Challenge - CSUN 2025
Ted Drake
?
CCleaner Professional Key with Crack [Latest New Version 2025]
CCleaner Professional Key with Crack [Latest New Version 2025]CCleaner Professional Key with Crack [Latest New Version 2025]
CCleaner Professional Key with Crack [Latest New Version 2025]
abidkhan77g77
?
Unified Observability - Alkin Tezuysal - FOSSASIA Summit March 2025 .pdf
Unified Observability - Alkin Tezuysal - FOSSASIA Summit  March 2025 .pdfUnified Observability - Alkin Tezuysal - FOSSASIA Summit  March 2025 .pdf
Unified Observability - Alkin Tezuysal - FOSSASIA Summit March 2025 .pdf
Alkin Tezuysal
?
Blending AI in Enterprise Architecture.pdf
Blending AI in Enterprise Architecture.pdfBlending AI in Enterprise Architecture.pdf
Blending AI in Enterprise Architecture.pdf
Calvin Hendryx-Parker
?

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 !!!!!!