Node.JS — What and Why?
What is Node.JS?
Node.js is not a programming language or a framework, but rather a runtime environment for JavaScript. Before 2009, JavaScript could only be run on web browsers, and each browser had its own JavaScript engine. For example, Edge has Chakra, Firefox has SpiderMonkey, and Chrome has V8.
In 2009, Ryan Dahl came up with the brilliant idea of running JavaScript outside the browser environment. He chose Google Chrome’s V8 engine, which is fast and more reliable than others, and put it inside an application built with the C++ language. He named this application “Node”, and it has been used ever since as a way to run JavaScript outside of the browser.
Why Node.JS?
JavaScript!, Yes, you can use one language for backend and frontend both and its JavaScript. It’s extremly fast since its running on v8 engine and it uses non — blocking asynchronous code which means that it can handle multiple requests at the same time without blocking the execution of other requests. This allows Node.js to handle a large number of concurrent connections efficiently, making it a great choice for building scalable web applications.
Why JS Engine?
Node is using google v8 engine and it compiles JavaScript code in to Machine code so the computer can understand what you’re saying. When JavaScript code is executed in a browser, it is interpreted by the browser’s JavaScript engine, which translates the code into bytecode that can be executed by the browser. In contrast, Node.js compiles the JavaScript code into machine code, which can be executed directly by the CPU. This results in faster and more efficient execution of JavaScript code.
What is NPM?
It stands for Node Package Manager and its the largest library for open source packages. using NPM, developers can easily install, manage packages that are avaibale in NPM registry. with those packages developers can save their time since they have resuable codes and can integrate with your projects.
What to do with Node.JS
Node.js is indeed a versatile platform that can be used for building a wide range of applications such as web-applications, mobile applications and. desktop applications. Additionally, Node.js has been expanding into other domains such as robotics and machine learning, which shows that its capability.
So node will have high demand in the present and future with the support of developers and contributors who are expanding the potential of Node.