Why to use Node.JS
In node.js. A browser might request something from your server, you begin responding to this request and another request comes in, let’s say both requests have to talk to an external database. You can ask the external database about the first request. And while the external database is thinking, you can begin to respond to the second request, your code isn’t doing two things at once, But when something else is working on something you are not held up waiting.
Other runtimes Don’t have this luxury building by default, Ruby on Rails. For example, it can process only one request at a time to process more than one at a time. You effectively have to buy more servers.
How to Install NodeJS
If you have a package manager on your system, you can use that instead. Node is available on package managers such as apt-get, Homebrew, and chocolatey. You can check out the official installing node.js for a package manager guide at https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
These programs will allow you to easily switch between node versions which is great If you want to have the stable version of the node and the exciting experimental pre-release versions. It also allows you to easily upgrade Node when new versions are released. NVM has a couple of other benefits that I like. It’s trivial to uninstall and it doesn’t need administrator (root) access to install it on your system.
NodeJS is used heavily used in generating server-side code. But modern cloud platforms Like AWS, GCP, or Azure use NodeJS to run serverless applications as well. NodeJS is also very popular in microservice-based applications.