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)

PPTX
CRM(Customer Relationship Managmnet) Presentation
PPTX
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
PDF
substrate PowerPoint Presentation basic one
PPTX
Report in SIP_Distance_Learning_Technology_Impact.pptx
PDF
GDG Cloud Southlake #45: Patrick Debois: The Impact of GenAI on Development a...
PDF
Addressing the challenges of harmonizing law and artificial intelligence tech...
PDF
Ericsson 5G Feature,KPIs Analysis_ Overview, Dependencies & Recommendations (...
PPTX
How to Convert Tickets Into Sales Opportunity in Odoo 18
PPT
Storage Area Network Best Practices from HP
PDF
CEH Module 2 Footprinting CEH V13, concepts
PPTX
Digital Convergence: How GIS, BIM, and CAD Revolutionize Asset Management
PDF
Technical Debt in the AI Coding Era - By Antonio Bianco
PPTX
maintenance powerrpoint for adaprive and preventive
PDF
NewMind AI Journal Monthly Chronicles - August 2025
PPTX
Blending method and technology for hydrogen.pptx
PDF
State of AI in Business 2025 - MIT NANDA
PDF
Human Computer Interaction Miterm Lesson
PPTX
From XAI to XEE through Influence and Provenance.Controlling model fairness o...
PDF
Data Virtualization in Action: Scaling APIs and Apps with FME
PDF
EGCB_Solar_Project_Presentation_and Finalcial Analysis.pdf
CRM(Customer Relationship Managmnet) Presentation
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
substrate PowerPoint Presentation basic one
Report in SIP_Distance_Learning_Technology_Impact.pptx
GDG Cloud Southlake #45: Patrick Debois: The Impact of GenAI on Development a...
Addressing the challenges of harmonizing law and artificial intelligence tech...
Ericsson 5G Feature,KPIs Analysis_ Overview, Dependencies & Recommendations (...
How to Convert Tickets Into Sales Opportunity in Odoo 18
Storage Area Network Best Practices from HP
CEH Module 2 Footprinting CEH V13, concepts
Digital Convergence: How GIS, BIM, and CAD Revolutionize Asset Management
Technical Debt in the AI Coding Era - By Antonio Bianco
maintenance powerrpoint for adaprive and preventive
NewMind AI Journal Monthly Chronicles - August 2025
Blending method and technology for hydrogen.pptx
State of AI in Business 2025 - MIT NANDA
Human Computer Interaction Miterm Lesson
From XAI to XEE through Influence and Provenance.Controlling model fairness o...
Data Virtualization in Action: Scaling APIs and Apps with FME
EGCB_Solar_Project_Presentation_and Finalcial Analysis.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