What Is Node.js
Node.js Introduction
As an asynchronous
event driven JavaScript runtime, Node is designed to build scalable network
applications.
·
Node.js is an open source server environment
·
Developed by Ryan Dahl.
·
Node.js runs on various platforms (Windows,
Linux, Unix, Mac OS X, etc.)
·
Node.js uses JavaScript on the server
·
Build on V8 engine, Chrome’s JavaScript engine.
·
NodeJS eco-system ‘npm’ is the largest in the
world for open source libraries.
Node.js Event
Loop
Simple Node.js
"Hellow World" example.
const http = require('http');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World\n');
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
Advantages of Node.js
·
Node.js offers an easy scalability
·
Easy to learn
·
Node.js is used as a single programming
language
·
The support of large and active community
·
Known for offering high performance
·
Offers the freedom to develop apps
Disadvantages
of Node.js

Comments
Post a Comment