Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
200 views21 pages

IT3501-Full Stack Web Development

The document provides an introduction to Node.js, highlighting its features such as being asynchronous, single-threaded, and event-driven, which contribute to its speed and scalability. It outlines the installation process and steps to create a simple Node.js program, as well as the functionality of the Node Package Manager (NPM) for managing packages. Additionally, it explains the concept of blocking versus non-blocking I/O, emphasizing the advantages of non-blocking for scalability.

Uploaded by

Sakkaravarthi S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
200 views21 pages

IT3501-Full Stack Web Development

The document provides an introduction to Node.js, highlighting its features such as being asynchronous, single-threaded, and event-driven, which contribute to its speed and scalability. It outlines the installation process and steps to create a simple Node.js program, as well as the functionality of the Node Package Manager (NPM) for managing packages. Additionally, it explains the concept of blocking versus non-blocking I/O, emphasizing the advantages of non-blocking for scalability.

Uploaded by

Sakkaravarthi S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

IT3501-FULL STACK WEB

DEVELOPMENT
NODE.JS INTRODUCTION & INSTALLATION

Prepared by
S.Sakkaravarthi, AP/IT
Ramco Institute of Technology, Rajapalayam
AGENDA

 Introduction to Node.js
 Features of Node.js
 Installation of Node.js
 Creating a Simple Node.js program
 Node Package Manager
 Node.js Module-HTTP
Introduction to Node.js

 Node.js is an Open Source run time environment for


Server-Side and networking applications

 It is Cross Platform environment and can run on any


platforms

 Uses Google Javascript V8 Engine to execute code


Introduction to Node.js

 Node.js provide a library to run javascript applications


outside the browser

 Node.js allows us to use JavaScript as a Server side


language

 Easy to Communicate with Database


Features of Node.js
 Asynchronous

 Single Threaded and Event-Driven

 Very Fast

 Scalable
Asynchronous
 Asynchronous
1. When request is made to Server, instead of waiting for the
request to complete, Server continues to process other requests
2. When request processing completes, the response is sent to
caller using callback mechanism
Single Threaded and Event-Driven
 Single Threaded and Event-Driven
Single Threaded

 Client send requests to Web Server

 Node.js adds the requests to the Event Queue

 Event Loop checks if the requests are simple enough not to


require any external resources
Single Threaded

 Event Loop processes simple requests and returns the responses to


the corresponding clients

 A Single thread from Thread pool is assigned to a single complex


request

 Thread Pool performs the required task and returns the response to
Event Loop, which in turn response to the client.
Very Fast & Scalable

 Very Fast & Scalable

1. Being built on Google Chrome’s V8 Javascript Engine,


Node.js library is very fast in code execution

2. Node.js is highly scalable because event mechanism helps


the server to respond in a non-blocking way.
Node.js Installation
Node.js Installation
Steps to be followed in Creating a Simple Node.js Program

 Import HTTP Module


 Define Port No
 Creating Server Instance
 Sending HTTP Header
 Sending Data
 Binding Server Instance with Port no 3000
Simple Node.js Program to display a Welcome Message
Simple Node.js Program to display a Welcome Message
Blocking Vs Non-Blocking I/O
Blocking Vs Non-Blocking I/O
Blocking Vs Non-Blocking I/O

 Incase of Asynchronous (non-blocking), once file I/O complete, it


will call the call back function

 This allows Node.js to be scalable and process large number of


request without worrying about blocking I/O.
Node Package Manager
 NPM stands for Node Package Manager
 Provides online repositories for node.js packages/modules
 Provides command line utility to install Node.js packages along
with version management and dependency management.
HTTP –Node.js Module
HTTP –Node.js Module

You might also like