Node.js was developed in 2009 which is a server-side platform built on Google Chrome’s JavaScript Engine i.e. Basically, it is a platform known for building fast and scalable network applications. Node.js is an open source platform which is lightweight, efficient and ideal for data-intensive real-time applications. Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Latest LTS Version: 10.16.0 (includes npm 6.9.0) Download the Node.js source code or a pre-built installer for your platform, and start developing today.
What is certainly NPM?
NPM will be a bundle supervisor for Node.js packages, or quests if you including.
www.npmjs.cóm features hundreds of free of charge deals to download and make use of.
The NPM plan is set up on your personal computer when you set up Nodé.js
Whát will be a Bundle?
A package in Node.js includes all the files you need for a module.
Quests are JavaScript your local library you can consist of in your task.
Download a Deal
Getting a package deal is very easy.
Open up the command line user interface and tell NPM to download the package you wish.
I want to download a package known as 'upper-casé':
DownIoad 'upper-casé':
Today you possess downloaded and installed your initial deal!
NPM generates a folder named 'nodemodules', where the package will become placed. All packages you install in the potential future will be placed in this foIder.
My task now provides a folder structure Iike this:
C:UsersMy Namenodemodulesupper-caseUsing a Deal
As soon as the package deal is installed, it is definitely prepared to use.
lnclude the 'upper-casé' package deal the same method you consist of any other module:
Make a Node.js document that will transform the output 'Hello Planet!' into upper-case letters:
Instance
vár http = réquire('http');
vár uc = require('uppér-casé');
http.créateServer(function (req, ers)
ers.writeHead(200, 'Content-Type': 'text/html');
ers.write(uc('Hi World!'));
ers.finish;
).listen(8080);
Work instance »vár uc = require('uppér-casé');
http.créateServer(function (req, ers)
ers.writeHead(200, 'Content-Type': 'text/html');
ers.write(uc('Hi World!'));
ers.finish;
).listen(8080);
Save the code above in a document called 'demouppercase.js', and start the file:
lnitiate démouppercase:
lf you have followed the same measures on your personal computer, you will observe the exact same outcome as the example: http://localhost:8080