SlideShare a Scribd company logo
Introduction to Node.JS
www.collaborationtech.co.in
Bengaluru INDIA
Presentation By
Ramananda M.S Rao
Content
Content
Overview
Why NodeJS
Environment Setup
Node.js Console or virtual command line environment REPL
Node Package Manager
Global vs. local package installation
The package.json configuration file or Node Configuration
Understanding CPS (Continuation Passing Style)
Automating tasks with Gulp
Command Line Interface
Node Process Model
Synchronous function
Call back Function
Event Loop
Node Event Loop
Creating a project
Utilities
Buffers
Event Emitters
Timers
Timers and Scheduling
www.collaborationtech.co.in
Content
Low level File Systems
Node Model System
Node Programming Model
HTTP communication
Streams
Binary Data
Code Execution
System Management ( Forks, Spawns and the Process )
Network Programming
TCP
Datagrams
Child process
TLS /SSL
HTTPS
Authentication
Web Sockets API
Socket IO and IO.js
JSON
Connecting to Databases
The Real-Time Web
Express framework
www.collaborationtech.co.in
Overview and Features
 Node.js uses an event-driven, non-blocking I/O model that makes it
lightweight and efficient, perfect for data-intensive real-time applications
that run across distributed devices.
 Node.js is an open source command line tool built for the server side
JavaScript code.
 The JavaScript is executed by the V8, a JavaScript engine developed by
Google which is used in Chrome browser. It uses a JavaScript API to
access the network and file system.
 With Node.js it is as simple as doing it in client-side JavaScript code.
 It can be easily used to create concurrent server applications.
 The package manager for Node.js is npm and it works very well. In many
ways it resembles package managers from other ecosystems, but npm is
fast, robust, and consistent. It does a great job specifying and installing
project dependencies. It keeps packages isolated from other projects,
avoiding version conflicts. But it also handles global installs of shell
commands and platform-dependent binaries.
www.collaborationtech.co.in
Node.js First Application
Creating Node.js Application
Step 1: import required http module
Step 2: create an server using http Create Server method.
Step3: Pass a port 8081 to listen method.
Step4: Create a js file named TestServer.js
Step5: Now run TestServer.js to see the result
Step 6: Verify the Output, Server has started
Step 7: Make a request to Node.js server
Step 8: Open http://127.0.0.1:8081/ on browser to see result.
www.collaborationtech.co.in
Node.js First Application
// TestServer.js
my_http = require("http");
my_http.createServer(function(request,response){
console.log("I got kicked");
response.writeHeader(200, {"Content-Type":
"text/plain"});
response.end("Hello World");
}).listen(8081);
console.log("Server Running on 8081");
www.collaborationtech.co.in
Node.JS- NPM
NPM (Node Package Manager) is included in
Node.js installation since Node version 0.6.0.,
so there is no need to install it separately
www.collaborationtech.co.in
Node.js Process Model
Node.js Process Model:
In this section, we will learn about the Node.js process
model and understand why we should use Node.js.
Traditional Web Server Model:
 In the traditional web server model, each request is
handled by a dedicated thread from the thread pool. If
no thread is available in the thread pool at any point of
time then the request waits till the next available thread.
 Dedicated thread executes a particular request and does
not return to thread pool until it completes the
execution and returns a response.traditional web server
model
www.collaborationtech.co.in
Node.js Process Model
Node.js Process Model:
 Node.js processes user requests differently when compared to a
traditional web server model. Node.js runs in a single process and the
application code runs in a single thread and thereby needs less resources
than other platforms. All the user requests to your web application will
be handled by a single thread and all the I/O work or long running job is
performed asynchronously for a particular request. So, this single thread
doesn't have to wait for the request to complete and is free to handle
the next request. When asynchronous I/O work completes then it
processes the request further and sends the response.
 An event loop is constantly watching for the events to be raised for an
asynchronous job and executing callback function when the job
completes. Internally, Node.js uses libev for the event loop which in turn
uses internal C++ thread pool to provide asynchronous I/O.
 The following figure illustrates asynchronous web server model using
Node.js.
www.collaborationtech.co.in
Follow us on Social
Facebook: https://www.facebook.com/collaborationtechnologies/
Twitter : https://twitter.com/collaboration09
Google Plus : https://plus.google.com/100704494006819853579
LinkedIn : https://www.linkedin.com/in/ramananda-rao-a2012545
Instagram : https://instagram.com/collaborationtechnologies
YouTube :
https://www.youtube.com/channel/UCm9nK56LRbWSqcYWbzs8CUg
Skype : facebook:ramananda.rao.7
WhatsApp : +91 9886272445
www.collaborationtech.co.in
THANK YOU
About Us

More Related Content

PPTX
Web Performance & Latest in React
ODP
Node.js architecture (EN)
PDF
Node js projects
PPTX
Node js Chapter-2
PDF
Blazor, lo sapevi che...
PPTX
Why I am hooked on the future of React
PPTX
Building Reliable Applications Using React, .NET & Azure
PPTX
Blazor - the successor of angular/react/vue?
Web Performance & Latest in React
Node.js architecture (EN)
Node js projects
Node js Chapter-2
Blazor, lo sapevi che...
Why I am hooked on the future of React
Building Reliable Applications Using React, .NET & Azure
Blazor - the successor of angular/react/vue?

What's hot (20)

PPTX
Kalp Corporate Node JS Perfect Guide
PDF
Queick: A Simple Job Queue System for Python
PPTX
Testing Microservices
PPTX
PDF
Developer-friendly taskqueues: What you should ask yourself before choosing one
PDF
3rd Generation Web Application Platforms
PDF
Tech io nodejs_20130531_v0.6
PDF
Node JS Express: Steps to Create Restful Web App
PDF
Asp.Net Core MVC , Razor page , Entity Framework Core
PDF
Grokking #9: Building a real-time and offline editing service with Couchbase
PDF
Learning React - I
PDF
DevOps <3 node.js
PDF
The complete-beginners-guide-to-react dyrr
PDF
Erik Wendel - Beyond JavaScript Frameworks: Writing Reliable Web Apps With El...
DOCX
Prudential Insurance Exp
PPTX
"Project Tye to Tie .NET Microservices", Oleg Karasik
PDF
Asynchronous job queues with python-rq
PDF
Isomorphic web application
PDF
Start with Angular framework
PPTX
Build Tools-Introduction (3)
Kalp Corporate Node JS Perfect Guide
Queick: A Simple Job Queue System for Python
Testing Microservices
Developer-friendly taskqueues: What you should ask yourself before choosing one
3rd Generation Web Application Platforms
Tech io nodejs_20130531_v0.6
Node JS Express: Steps to Create Restful Web App
Asp.Net Core MVC , Razor page , Entity Framework Core
Grokking #9: Building a real-time and offline editing service with Couchbase
Learning React - I
DevOps <3 node.js
The complete-beginners-guide-to-react dyrr
Erik Wendel - Beyond JavaScript Frameworks: Writing Reliable Web Apps With El...
Prudential Insurance Exp
"Project Tye to Tie .NET Microservices", Oleg Karasik
Asynchronous job queues with python-rq
Isomorphic web application
Start with Angular framework
Build Tools-Introduction (3)
Ad

Viewers also liked (7)

PDF
Node.js - Server Side Javascript
PPTX
Introduction to JPA Framework
PPTX
Node.js'e Hızlı Bir Bakış
PDF
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
PPTX
Introduction to Node.js
PPTX
Real World Lessons on the Pain Points of Node.JS Application
KEY
Node.js - Best practices
Node.js - Server Side Javascript
Introduction to JPA Framework
Node.js'e Hızlı Bir Bakış
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
Introduction to Node.js
Real World Lessons on the Pain Points of Node.JS Application
Node.js - Best practices
Ad

Similar to Introduction to Node.JS (20)

PPTX
Introduction to node
PPTX
PDF
Introduction to Node JS.pdf
PPTX
PPT
18_Node.js.ppt
ODP
Introduce about Nodejs - duyetdev.com
PDF
Node.js for beginner
PDF
NodeJS for Beginner
PPTX
Intro to Node
PPT
18_Node.js.ppt
PPTX
Unit 1 Express J for mean stack and mern
PDF
Nodejs a-practical-introduction-oredev
PPTX
Introduction to Node (15th May 2017)
PDF
Node.js 101 with Rami Sayar
KEY
Node.js - A practical introduction (v2)
PDF
FITC - Node.js 101
PPTX
introduction to node.js
PPTX
Node js introduction
PPTX
NodeJS - Server Side JS
PPT
Introducción y comandos en NodeJS slodte
Introduction to node
Introduction to Node JS.pdf
18_Node.js.ppt
Introduce about Nodejs - duyetdev.com
Node.js for beginner
NodeJS for Beginner
Intro to Node
18_Node.js.ppt
Unit 1 Express J for mean stack and mern
Nodejs a-practical-introduction-oredev
Introduction to Node (15th May 2017)
Node.js 101 with Rami Sayar
Node.js - A practical introduction (v2)
FITC - Node.js 101
introduction to node.js
Node js introduction
NodeJS - Server Side JS
Introducción y comandos en NodeJS slodte

More from Collaboration Technologies (16)

PPTX
Introduction to Core Java Programming
PPTX
Introduction to Database SQL & PL/SQL
PPTX
Introduction to Advanced Javascript
PPTX
Introduction to AngularJS
PPTX
Introduction to Bootstrap
PPTX
Introduction to Hibernate Framework
PPTX
Introduction to HTML4
PPTX
Introduction to HTML5
PPTX
Introduction to JavaScript Programming
PPTX
Introduction to jQuery
PPTX
Introduction to Perl Programming
PPTX
Introduction to PHP
PPTX
Introduction to Python Basics Programming
PPTX
Introduction to Spring Framework
PPTX
Introduction to Struts 2
PPTX
Introduction to JSON & AJAX
Introduction to Core Java Programming
Introduction to Database SQL & PL/SQL
Introduction to Advanced Javascript
Introduction to AngularJS
Introduction to Bootstrap
Introduction to Hibernate Framework
Introduction to HTML4
Introduction to HTML5
Introduction to JavaScript Programming
Introduction to jQuery
Introduction to Perl Programming
Introduction to PHP
Introduction to Python Basics Programming
Introduction to Spring Framework
Introduction to Struts 2
Introduction to JSON & AJAX

Recently uploaded (20)

PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Machine learning based COVID-19 study performance prediction
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Big Data Technologies - Introduction.pptx
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Review of recent advances in non-invasive hemoglobin estimation
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
MYSQL Presentation for SQL database connectivity
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Chapter 3 Spatial Domain Image Processing.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
“AI and Expert System Decision Support & Business Intelligence Systems”
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Understanding_Digital_Forensics_Presentation.pptx
Electronic commerce courselecture one. Pdf
Encapsulation_ Review paper, used for researhc scholars
Machine learning based COVID-19 study performance prediction
Reach Out and Touch Someone: Haptics and Empathic Computing
Big Data Technologies - Introduction.pptx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf

Introduction to Node.JS

  • 1. Introduction to Node.JS www.collaborationtech.co.in Bengaluru INDIA Presentation By Ramananda M.S Rao
  • 2. Content Content Overview Why NodeJS Environment Setup Node.js Console or virtual command line environment REPL Node Package Manager Global vs. local package installation The package.json configuration file or Node Configuration Understanding CPS (Continuation Passing Style) Automating tasks with Gulp Command Line Interface Node Process Model Synchronous function Call back Function Event Loop Node Event Loop Creating a project Utilities Buffers Event Emitters Timers Timers and Scheduling www.collaborationtech.co.in
  • 3. Content Low level File Systems Node Model System Node Programming Model HTTP communication Streams Binary Data Code Execution System Management ( Forks, Spawns and the Process ) Network Programming TCP Datagrams Child process TLS /SSL HTTPS Authentication Web Sockets API Socket IO and IO.js JSON Connecting to Databases The Real-Time Web Express framework www.collaborationtech.co.in
  • 4. Overview and Features  Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.  Node.js is an open source command line tool built for the server side JavaScript code.  The JavaScript is executed by the V8, a JavaScript engine developed by Google which is used in Chrome browser. It uses a JavaScript API to access the network and file system.  With Node.js it is as simple as doing it in client-side JavaScript code.  It can be easily used to create concurrent server applications.  The package manager for Node.js is npm and it works very well. In many ways it resembles package managers from other ecosystems, but npm is fast, robust, and consistent. It does a great job specifying and installing project dependencies. It keeps packages isolated from other projects, avoiding version conflicts. But it also handles global installs of shell commands and platform-dependent binaries. www.collaborationtech.co.in
  • 5. Node.js First Application Creating Node.js Application Step 1: import required http module Step 2: create an server using http Create Server method. Step3: Pass a port 8081 to listen method. Step4: Create a js file named TestServer.js Step5: Now run TestServer.js to see the result Step 6: Verify the Output, Server has started Step 7: Make a request to Node.js server Step 8: Open http://127.0.0.1:8081/ on browser to see result. www.collaborationtech.co.in
  • 6. Node.js First Application // TestServer.js my_http = require("http"); my_http.createServer(function(request,response){ console.log("I got kicked"); response.writeHeader(200, {"Content-Type": "text/plain"}); response.end("Hello World"); }).listen(8081); console.log("Server Running on 8081"); www.collaborationtech.co.in
  • 7. Node.JS- NPM NPM (Node Package Manager) is included in Node.js installation since Node version 0.6.0., so there is no need to install it separately www.collaborationtech.co.in
  • 8. Node.js Process Model Node.js Process Model: In this section, we will learn about the Node.js process model and understand why we should use Node.js. Traditional Web Server Model:  In the traditional web server model, each request is handled by a dedicated thread from the thread pool. If no thread is available in the thread pool at any point of time then the request waits till the next available thread.  Dedicated thread executes a particular request and does not return to thread pool until it completes the execution and returns a response.traditional web server model www.collaborationtech.co.in
  • 9. Node.js Process Model Node.js Process Model:  Node.js processes user requests differently when compared to a traditional web server model. Node.js runs in a single process and the application code runs in a single thread and thereby needs less resources than other platforms. All the user requests to your web application will be handled by a single thread and all the I/O work or long running job is performed asynchronously for a particular request. So, this single thread doesn't have to wait for the request to complete and is free to handle the next request. When asynchronous I/O work completes then it processes the request further and sends the response.  An event loop is constantly watching for the events to be raised for an asynchronous job and executing callback function when the job completes. Internally, Node.js uses libev for the event loop which in turn uses internal C++ thread pool to provide asynchronous I/O.  The following figure illustrates asynchronous web server model using Node.js. www.collaborationtech.co.in
  • 10. Follow us on Social Facebook: https://www.facebook.com/collaborationtechnologies/ Twitter : https://twitter.com/collaboration09 Google Plus : https://plus.google.com/100704494006819853579 LinkedIn : https://www.linkedin.com/in/ramananda-rao-a2012545 Instagram : https://instagram.com/collaborationtechnologies YouTube : https://www.youtube.com/channel/UCm9nK56LRbWSqcYWbzs8CUg Skype : facebook:ramananda.rao.7 WhatsApp : +91 9886272445 www.collaborationtech.co.in THANK YOU