0% found this document useful (0 votes)
6 views

Node.js ppt

Node.js is an open-source, cross-platform server-side environment built on Google's V8 JavaScript Engine, allowing for the development of fast, non-blocking applications. It is suitable for various applications, including I/O bound, data streaming, and single-page applications, and uses JavaScript files with a '.js' extension. Node.js features a built-in HTTP module for creating web servers that can handle requests and responses efficiently.

Uploaded by

bhukyasaidanaik
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)
6 views

Node.js ppt

Node.js is an open-source, cross-platform server-side environment built on Google's V8 JavaScript Engine, allowing for the development of fast, non-blocking applications. It is suitable for various applications, including I/O bound, data streaming, and single-page applications, and uses JavaScript files with a '.js' extension. Node.js features a built-in HTTP module for creating web servers that can handle requests and responses efficiently.

Uploaded by

bhukyasaidanaik
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/ 12

• KNOWLEDGE TRANSFORMATION

• SUBJECT :NODE.JS
• NAME : B.SAIDA NAIK
• DEPT :AIML
• What is Node.js?
• Node.js is an open source server
environment
• Node.js is a server-side platform built on
Google Chrome's JavaScript Engine (V8
Engine).
• Node.js is free
• Node.js runs on various platforms
(Windows, Linux, Unix, Mac OS X, etc.)
• Node.js uses JavaScript on the server
• Node.js was developed by Ryan Dahl in
2009 and its latest version is v0.10.36.
• Node.js = Runtime Environment +
JavaScript Library
• Node.js is an open source, cross-platform
runtime environment for developing
server-side and networking applications.
Features of Node.js
• Asynchronous and Event Driven − All
APIs of Node.js library are
asynchronous,that is, non-blocking.
• Node.js based server never waits for an
API to return data.
• Very Fast − Being built on Google
Chrome's V8 JavaScript Engine, Node.js
library is very fast in code execution.
• No Buffering − Node.js applications never
buffer any data. These applications simply
output the data in chunks.
• License − Node.js is released under the
MIT license.
Where to Use Node.js?
• Following are the areas where Node.js is
proving itself as a perfect technology
partner.
• I/O bound Applications
• Data Streaming Applications
• Data Intensive Real-time Applications
(DIRT)
• JSON APIs based Applications
• Single Page Applications
What is a Node.js File?
•Node.js files contain tasks that will be
executed on certain events

•A typical event is someone trying to


access a port on the server

•Node.js files must be initiated on the


server before having any effect
•Node.js files have extension ".js"
What Can Node.js Do?
•Node.js can generate dynamic page
content

•Node.js can create, open, read, write,


delete, and close files on the server

•Node.js can collect form data

•Node.js can add, delete, modify data in


your database
Getting Started
Once you have downloaded and installed
Node.js on your computer, let's try to
display "Hello World" in a web browser.

Create a Node.js file named "myfirst.js",


and add the following code:

myfirst.js
var http = require('http');

http.createServer(function (req, res) {

res.writeHead(200, {'Content-Type': 'text/html'});

res.end('Hello World!');

}).listen(8080);
The Built-in HTTP Module
Node.js has a built-in module called HTTP, which
allows Node.js to transfer data over the Hyper Text
Transfer Protocol (HTTP).

To include the HTTP module, use


the require() method:

var http = require('http');

Node.js as a Web Server

The HTTP module can create an HTTP server that


listens to server ports and gives a response back to
the client.

Use the createServer() method to create an HTTP


server:
var http = require('http');
//create a server object:
http.createServer(function (req,
res) {
res.write('Hello
World!'); //write a response to
the client
res.end(); //end the response
}).listen(8080); //the server
object listens on port 8080
• THANK YOU

You might also like