SlideShare une entreprise Scribd logo
1  sur  34
Introduction
To
Prepared By
Jiban
jiban@cslsoft.com
Plan
• What is Node.JS
• Event Driven
• Blocking Vs. No Blocking
• What can I do in node
• Install node.js
• A simple node.js example
• Create a web Server using Node.js
• Some node.js frameworks
• A demo with express.js
• Who Uses node.js
What is Node?
• JavaScript based software system
• Event driven
• Non- blocking
• Launched in 2009
• Founded by Ryan Dahl
I/O Event-loop based server
• A tale about bunnies, hamsters and
Squids…
A hamster visiting your site
Single threaded bunny
(a happy bunny)
Your web server
Impatient hamsters
Single threaded bunny
Your web server
(a busy bunny!)
Multi-threaded bunny
Your web server
Fetching
database (2s)
Consuming
Service (3s)
Writing to a file
(3s)
Event-loop based server
Hyperactive squid
Constantly check
who is idle doing
nothing or waiting
Node.js runs on the event loop
• The event loop keeps on running. Checking for
new events, so it can call callbacks for those
events.
Blocking vs. Non-Blocking
Doctor’s Surgery vs. Fast-food Outlet
Doctor’s Surgery
(Blocking Process)
Fast-food Outlet
(Non-blocking Process)
Non-Blocking? Blocking? I’m so confused
• By introducing callbacks. Node can move on to
other requests and whenever the callback is
called, node will process is.
• You should read non-blocking code as « put
function and params in queue and fire
callback when you reach the end of the
queue »
• Blocking= return Non-Blocking= no return.
Only callbacks
Well, That’s Node.js
What Can I Do in Node?
• Anything you want!
• Chat servers, Analytics & Crazy fast backends
• Socket.io library is a wicked way to build real
time apps
• Build a social Network! LinkedIn, Dropbox all
using Node.js
Using Modules
• In node.js require(‘ ’) is using a lot.
• Require is basically a way to import modules
to your application. Modules are basically
classes.
• They are a module of code that contain
functions which have been exported.
• Exported functions are basically public.
Install node.js
• Go to the NodeJS home page
• Click install to download the .msi installer
package
• Run it and follow the instrucitons, you now
have NPM (node package manager) and
Node.js installed
• Reset your computer to get everything
working in your command-line interface (CLI)
A simple node.js application
var http = require("http");
var server = http.createServer();
server.listen(8888);
function say(word) {
console.log(word);
}
function execute(someFunction, value) {
someFunction(value);
}
execute(say, "Beautiful Bangladesh");
Creating a web server
with
node.js
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type':
'text/plain'});
res.end('Hello Worldn');
}).listen(1337, "127.0.0.1");
console.log('Server running at
http://127.0.0.1:1337/');
Node.js Frameworks
Node.js is one of the most popular javascript
framework that allow to build scalable network
web applications. Node.js contains a different
kind of frameworks such as MVC framework, full-
stack framework, REST API and generators, lots of
libraries as server library that making it possible
to sun a web server without use of external
software such as Apache and Lighttpd. These
frameworks makes it more user-friendly and easy
to use, also supports a large number of features
and functionality to develop huge web
applications in just follow few steps.
Sails.js
Sails is one of the excellent framework that
make it easy to develop custom, enterprise-
grade and modern Node.js apps, also it’s good
for building charts, dashboards and multiple
games.
Total.js
Total.js is another great framework for
Node.js helps to create web pages and web
applications, also supports MVC architecture.
This is the open source modern framework
for building websites using HTML, javaScript
and CSS.
Partial.js
Partial js, framework for Node.js, Using HTML,
CSS and JavaScript developers can build large
scale of web applications and websites.
Features and architecture are same as total.js.
Koa.js
This framework for Node.js is designed by
team of Express. Koa.js is next generation
tool, which aims to be a smaller, more
expressive, and more robust foundation for
web applications and APIs.
Locomotive.js
Locomotive supports MVC pattern, RESTful
routes also builds on Express. This is one of
the most powerful web framework for
Node.js, present great features : -
1) convention over configuration
2) Routing Helpers
3) MVC Architecture
4) connect to any Database and more.
Express.js
Most Popular web framework for Node.js over
the internet and among web developers. Using
robust set of features developers can
create single and multi-page, and hybrid web
applications.
Flatiron.js
Flatiron.js is also a modern and next
generation web framework for developers that
helps to building impressive and huge web
application with its advance features.
Express.io
Express.io is realtime web framework for
Node.js. And also supports MVC architecture
for create web applications.
Socket Stream
Socket stream is dedicated to building real
time single page applications with its fast and
modular nature.
Geddy.js
Geddy.js is simple, structured and original MVC
web framework for Node.js for building
advance web application.
Demo
Create An
Application Using
Express.js
Companies using node
https://github.com/joyent/node/wiki/Projects,-Applications,-and-Companies-Using-Node
Thank you
jiban@cslsoft.com

Contenu connexe

Tendances

Node.js tutoria for beginner
Node.js tutoria for beginnerNode.js tutoria for beginner
Node.js tutoria for beginnerManinder Singh
 
JavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
JavaScript as a Server side language (NodeJS): JSConf 2011, DhakaJavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
JavaScript as a Server side language (NodeJS): JSConf 2011, DhakaNurul Ferdous
 
Node.js, for architects - OpenSlava 2013
Node.js, for architects - OpenSlava 2013Node.js, for architects - OpenSlava 2013
Node.js, for architects - OpenSlava 2013Oscar Renalias
 
Complete MVC on NodeJS
Complete MVC on NodeJSComplete MVC on NodeJS
Complete MVC on NodeJSHüseyin BABAL
 
Introduction to node.js GDD
Introduction to node.js GDDIntroduction to node.js GDD
Introduction to node.js GDDSudar Muthu
 
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...Edureka!
 
Nodejs getting started
Nodejs getting startedNodejs getting started
Nodejs getting startedTriet Ho
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureColin Mackay
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialTom Croucher
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.jsVikash Singh
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node jsAkshay Mathur
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.jsDinesh U
 
Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS drupalcampest
 

Tendances (20)

Node.js tutoria for beginner
Node.js tutoria for beginnerNode.js tutoria for beginner
Node.js tutoria for beginner
 
Node js for beginners
Node js for beginnersNode js for beginners
Node js for beginners
 
JavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
JavaScript as a Server side language (NodeJS): JSConf 2011, DhakaJavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
JavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
 
Node.js, for architects - OpenSlava 2013
Node.js, for architects - OpenSlava 2013Node.js, for architects - OpenSlava 2013
Node.js, for architects - OpenSlava 2013
 
Complete MVC on NodeJS
Complete MVC on NodeJSComplete MVC on NodeJS
Complete MVC on NodeJS
 
Node.js for beginner
Node.js for beginnerNode.js for beginner
Node.js for beginner
 
Introduction to node.js GDD
Introduction to node.js GDDIntroduction to node.js GDD
Introduction to node.js GDD
 
Node.js architecture (EN)
Node.js architecture (EN)Node.js architecture (EN)
Node.js architecture (EN)
 
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
 
Nodejs getting started
Nodejs getting startedNodejs getting started
Nodejs getting started
 
Node js Introduction
Node js IntroductionNode js Introduction
Node js Introduction
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azure
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js Tutorial
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
 
Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS
 
Best node js course
Best node js courseBest node js course
Best node js course
 
Nodejs
NodejsNodejs
Nodejs
 

En vedette (20)

Presentation EOI - Apps & Tech 2.0
Presentation EOI - Apps & Tech 2.0Presentation EOI - Apps & Tech 2.0
Presentation EOI - Apps & Tech 2.0
 
Exploring Mobisy
Exploring MobisyExploring Mobisy
Exploring Mobisy
 
Business process reengineering
Business process reengineeringBusiness process reengineering
Business process reengineering
 
Burgan
BurganBurgan
Burgan
 
Usa today api
Usa today apiUsa today api
Usa today api
 
Datasheet hp-quicktest-professional-and-deviceanywhere-solutions
Datasheet hp-quicktest-professional-and-deviceanywhere-solutionsDatasheet hp-quicktest-professional-and-deviceanywhere-solutions
Datasheet hp-quicktest-professional-and-deviceanywhere-solutions
 
Pragadees Resume
Pragadees ResumePragadees Resume
Pragadees Resume
 
Агман Забуровна
Агман ЗабуровнаАгман Забуровна
Агман Забуровна
 
Assignement
AssignementAssignement
Assignement
 
Want to become a speaker at ROCKIT?
Want to become a speaker at ROCKIT? Want to become a speaker at ROCKIT?
Want to become a speaker at ROCKIT?
 
Top indian deans at world's best b schools
Top indian deans at world's best b schoolsTop indian deans at world's best b schools
Top indian deans at world's best b schools
 
Co
CoCo
Co
 
Security Threat Presentation
Security Threat PresentationSecurity Threat Presentation
Security Threat Presentation
 
CS1308 - 02/08/10
CS1308 - 02/08/10CS1308 - 02/08/10
CS1308 - 02/08/10
 
Profitable Sustainability
Profitable SustainabilityProfitable Sustainability
Profitable Sustainability
 
GoToMeetings
GoToMeetingsGoToMeetings
GoToMeetings
 
Accudemia - Setup custom screens and imports
Accudemia - Setup custom screens and importsAccudemia - Setup custom screens and imports
Accudemia - Setup custom screens and imports
 
CDC "Daterium-4"
CDC "Daterium-4"CDC "Daterium-4"
CDC "Daterium-4"
 
Santosh Das
Santosh DasSantosh Das
Santosh Das
 
Score your Goals, Leave Password Management to us!
Score your Goals, Leave Password Management to us!Score your Goals, Leave Password Management to us!
Score your Goals, Leave Password Management to us!
 

Similaire à Introduction to node.js by jiban

Node.js In The Enterprise - A Primer
Node.js In The Enterprise - A PrimerNode.js In The Enterprise - A Primer
Node.js In The Enterprise - A PrimerNaveen S.R
 
Top 10 frameworks of node js
Top 10 frameworks of node jsTop 10 frameworks of node js
Top 10 frameworks of node jsHabilelabs
 
node_js.pptx
node_js.pptxnode_js.pptx
node_js.pptxdipen55
 
What is Mean Stack Development ?
What is Mean Stack Development ?What is Mean Stack Development ?
What is Mean Stack Development ?Balajihope
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsasync_io
 
Node js installation steps.pptx slide share ppts
Node js installation steps.pptx slide share pptsNode js installation steps.pptx slide share ppts
Node js installation steps.pptx slide share pptsHemaSenthil5
 
An Introduction to Node.js Development with Windows Azure
An Introduction to Node.js Development with Windows AzureAn Introduction to Node.js Development with Windows Azure
An Introduction to Node.js Development with Windows AzureTroy Miles
 
Kalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate
 
Node.js for .NET Developers
Node.js for .NET DevelopersNode.js for .NET Developers
Node.js for .NET DevelopersDavid Neal
 
Node PDX: Intro to Sails.js
Node PDX: Intro to Sails.jsNode PDX: Intro to Sails.js
Node PDX: Intro to Sails.jsMike McNeil
 
Going Offline with JS
Going Offline with JSGoing Offline with JS
Going Offline with JSbrendankowitz
 
Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)Chris Cowan
 

Similaire à Introduction to node.js by jiban (20)

Node.js In The Enterprise - A Primer
Node.js In The Enterprise - A PrimerNode.js In The Enterprise - A Primer
Node.js In The Enterprise - A Primer
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Top 10 frameworks of node js
Top 10 frameworks of node jsTop 10 frameworks of node js
Top 10 frameworks of node js
 
Node js
Node jsNode js
Node js
 
NodeJS Presentation
NodeJS PresentationNodeJS Presentation
NodeJS Presentation
 
Node.js on Azure
Node.js on AzureNode.js on Azure
Node.js on Azure
 
node_js.pptx
node_js.pptxnode_js.pptx
node_js.pptx
 
What is Mean Stack Development ?
What is Mean Stack Development ?What is Mean Stack Development ?
What is Mean Stack Development ?
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.js
 
Node js installation steps.pptx slide share ppts
Node js installation steps.pptx slide share pptsNode js installation steps.pptx slide share ppts
Node js installation steps.pptx slide share ppts
 
An Introduction to Node.js Development with Windows Azure
An Introduction to Node.js Development with Windows AzureAn Introduction to Node.js Development with Windows Azure
An Introduction to Node.js Development with Windows Azure
 
Intro to Sails.js
Intro to Sails.jsIntro to Sails.js
Intro to Sails.js
 
Kalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect Guide
 
Node.js for .NET Developers
Node.js for .NET DevelopersNode.js for .NET Developers
Node.js for .NET Developers
 
Nodejs
NodejsNodejs
Nodejs
 
NodeJS and what is actually does
NodeJS and what is actually doesNodeJS and what is actually does
NodeJS and what is actually does
 
Meanstack overview
Meanstack overviewMeanstack overview
Meanstack overview
 
Node PDX: Intro to Sails.js
Node PDX: Intro to Sails.jsNode PDX: Intro to Sails.js
Node PDX: Intro to Sails.js
 
Going Offline with JS
Going Offline with JSGoing Offline with JS
Going Offline with JS
 
Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)
 

Dernier

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Dernier (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 

Introduction to node.js by jiban

  • 2. Plan • What is Node.JS • Event Driven • Blocking Vs. No Blocking • What can I do in node • Install node.js • A simple node.js example • Create a web Server using Node.js • Some node.js frameworks • A demo with express.js • Who Uses node.js
  • 3. What is Node? • JavaScript based software system • Event driven • Non- blocking • Launched in 2009 • Founded by Ryan Dahl
  • 4. I/O Event-loop based server • A tale about bunnies, hamsters and Squids…
  • 5. A hamster visiting your site Single threaded bunny (a happy bunny) Your web server
  • 6. Impatient hamsters Single threaded bunny Your web server (a busy bunny!)
  • 7. Multi-threaded bunny Your web server Fetching database (2s) Consuming Service (3s) Writing to a file (3s)
  • 8. Event-loop based server Hyperactive squid Constantly check who is idle doing nothing or waiting
  • 9. Node.js runs on the event loop • The event loop keeps on running. Checking for new events, so it can call callbacks for those events.
  • 10. Blocking vs. Non-Blocking Doctor’s Surgery vs. Fast-food Outlet
  • 13. Non-Blocking? Blocking? I’m so confused • By introducing callbacks. Node can move on to other requests and whenever the callback is called, node will process is. • You should read non-blocking code as « put function and params in queue and fire callback when you reach the end of the queue » • Blocking= return Non-Blocking= no return. Only callbacks
  • 15. What Can I Do in Node? • Anything you want! • Chat servers, Analytics & Crazy fast backends • Socket.io library is a wicked way to build real time apps • Build a social Network! LinkedIn, Dropbox all using Node.js
  • 16. Using Modules • In node.js require(‘ ’) is using a lot. • Require is basically a way to import modules to your application. Modules are basically classes. • They are a module of code that contain functions which have been exported. • Exported functions are basically public.
  • 17. Install node.js • Go to the NodeJS home page • Click install to download the .msi installer package • Run it and follow the instrucitons, you now have NPM (node package manager) and Node.js installed • Reset your computer to get everything working in your command-line interface (CLI)
  • 18. A simple node.js application var http = require("http"); var server = http.createServer(); server.listen(8888); function say(word) { console.log(word); } function execute(someFunction, value) { someFunction(value); } execute(say, "Beautiful Bangladesh");
  • 19. Creating a web server with node.js var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello Worldn'); }).listen(1337, "127.0.0.1"); console.log('Server running at http://127.0.0.1:1337/');
  • 20.
  • 21. Node.js Frameworks Node.js is one of the most popular javascript framework that allow to build scalable network web applications. Node.js contains a different kind of frameworks such as MVC framework, full- stack framework, REST API and generators, lots of libraries as server library that making it possible to sun a web server without use of external software such as Apache and Lighttpd. These frameworks makes it more user-friendly and easy to use, also supports a large number of features and functionality to develop huge web applications in just follow few steps.
  • 22. Sails.js Sails is one of the excellent framework that make it easy to develop custom, enterprise- grade and modern Node.js apps, also it’s good for building charts, dashboards and multiple games.
  • 23. Total.js Total.js is another great framework for Node.js helps to create web pages and web applications, also supports MVC architecture. This is the open source modern framework for building websites using HTML, javaScript and CSS.
  • 24. Partial.js Partial js, framework for Node.js, Using HTML, CSS and JavaScript developers can build large scale of web applications and websites. Features and architecture are same as total.js.
  • 25. Koa.js This framework for Node.js is designed by team of Express. Koa.js is next generation tool, which aims to be a smaller, more expressive, and more robust foundation for web applications and APIs.
  • 26. Locomotive.js Locomotive supports MVC pattern, RESTful routes also builds on Express. This is one of the most powerful web framework for Node.js, present great features : - 1) convention over configuration 2) Routing Helpers 3) MVC Architecture 4) connect to any Database and more.
  • 27. Express.js Most Popular web framework for Node.js over the internet and among web developers. Using robust set of features developers can create single and multi-page, and hybrid web applications.
  • 28. Flatiron.js Flatiron.js is also a modern and next generation web framework for developers that helps to building impressive and huge web application with its advance features.
  • 29. Express.io Express.io is realtime web framework for Node.js. And also supports MVC architecture for create web applications.
  • 30. Socket Stream Socket stream is dedicated to building real time single page applications with its fast and modular nature.
  • 31. Geddy.js Geddy.js is simple, structured and original MVC web framework for Node.js for building advance web application.