Before going into details about Node.js, First, tell about What is Node.Js?
Now, let’s go through the reasons why Node.js is so popular these days?
- Asynchronous and Event Driven: Node.js all APIs libraries are asynchronous, that is, non-blocking. it actually means a Node.js server never waits for an API to return data. The server moves to the next API after calling it and a notification of Events of a Node.js to helps the server to get a response from the last API call.
- Node Community Support/NPM: There is a very large and intelligent community that is working on making Node.js better every day. Node.JS communities have a large number of code packages and modules, which can be used to build web applications. Node Package Manager (NPM) is an online archive where open source Node.JS projects are published. NPM provides packages of re-usable codes which can be assembled as per your project requirements. With more than 700,000 reusable codes NPM hosts the world’s largest collection of Node.JS projects.
According to hackerrank report, Nodejs is the most popular framework among for all ages of developers.
Before start working on Node.Js environment, first of all, we need a Node.js environment for developing the app. So I’m telling now about,
How to install Node.js in ubuntu.
Before installing Nodejs in Ubuntu, we have to update the OS and install a curl package.
Once all its done correctly, then need to download and run the install script which provided from NodeSource. Just add the Curl in the script.
It will take to download the script, after completed, then a need to install the Nodejs package.
After installation is done, you can check a version of node, npm:
Simple Hello World Code:
First, open your terminal and make a new directory for hello world app. and init the npm packages.
After init the app, we have needed the details, otherwise, leave blanks for just enter until the last step.
Now need to create app.js file for hello world code, after crested the app.js have to add the below code into an editor.
Code: console.log(‘Hello World’);
and save it’s and run the code by using command ~node app.js
Thanks for reading and visiting our site…………..