Node.js

Ushini Avindika
4 min readMay 28, 2021

--

What is Node.js?

It is a cross-platform, open-source back-end JavaScript runtime environment that uses the V8 engine to execute JavaScript code outside of a web browser. It is initialy wriiten in 2009 by Ryan Dahl. Node.js allows developers to use JavaScript to create command-line tools and server-side scripting, which involves running scripts on the server before sending the page to the user’s browser.

Features of Node.js

Non Blocking Thread execution : It means we continue executing the next tasks in the stack while we wait for a response from something outside of our execution chain, such as loading data, reading from a database, or polling a remote service. Therefore NodeJS extremely fast and powerful.

Multi threaded : Since Node.js is non-blocking, all functions ( callbacks ) are assigned to the event loop, where they are ( or can be ) executed by multiple threads. The run-time of Node.js takes care of this. Multiple processes can be forked in Node.js ( which are executed on different cores ). It’s important to understand that the master and forked processes don’t share state.With the function send, we can send messages to the forked process (which is a different script) and to the master process from the forked process.

Cross platform : NodeJS is not only cross platform (can be use in multiple systems), but it can also be bundled into an executable with all of its own dependencies when built with the proper structure.

Build vs Compile : If you’re a developer who wants to test their code as they go, seeing the code run in under a second vs. 30 seconds or more for.net and Java equivalent scale systems is a game changer in terms of delivery speed.

Free open source packages on NPM : The Node community is massive, and there are countless permissive open source projects available to help you save time. Simple helpers and charts to full-fledged frameworks are all available in these libraries.

How To Install Node.js?

Step 1: First go to https://nodejs.org/en/download/ site and download the binary files we needed.

Example ; download the 32-bit setup file.

Click on the .msi file twice and initiate the installation. Then click on the “Run” button to initiate the installation.

Step 2: Next click on the “Next” button to continue the installation.

Step 3: Accept the license agreement and click on the “Next” button

Step 4: Next choose the location where Node.js needs to get installed and then click on the “Next” button.

Step 5: Choose the components that will be installed by default. Accept the default components and move on to the next step by clicking the Next button.

Step 6: Next click on the “Install” button to install Node.js on windows

Step 7: Complete the installation by clicking on the “Finish” button

To verify the installation :

$ node -v v0.8.16 $ npm -v 1.1.69

Now, You have successfully installed Node.js

Thank you!

--

--