Node . JS
-
Node.js® is a JavaScript runtime built on Chrome’s V8 JavaScript engine.
- Node.js is an event-based, non-blocking, asynchronous I/O runtime that uses Google’s V8 JavaScript engine and libuv library.
The V8 engine
is the open-source JavaScript engine that runs in Google Chrome and other Chromium-based web browsers, including Brave, Opera, and Vivaldi.- It was designed with performance in mind and is responsible for compiling JavaScript directly to native machine code that your computer can execute.
- Node.js is a program we can use to execute JavaScript on our computers. In other words, it’s a JavaScript runtime.
What Is Node.js Used For?
- They can be used for anything from bundling your JavaScript files and dependencies into static assets, to running tests, or automatic code linting and style checking.
Node.js Lets Us Run JavaScript on the Server
- Node.js, however, is single-threaded.
-
t’s also event-driven, which means that everything that happens in Node is in reaction to an event.
- The following image depicts Node’s execution model:
- Node is particularly suited to building applications that require some form of real-time interaction or collaboration — for example, chat sites.
-
It’s also a good fit for building APIs where you’re handling lots of requests that are I/O driven (such as those needing to perform operations on a database) .
- It can be used as a scripting language to automate repetitive or error prone tasks on your PC. .
- Node.js can also can be used to build cross-platform desktop apps and even to create your own robots.