DEV Community

Cover image for Get to Know N of MEAN Stack
Farhat Sharif
Farhat Sharif

Posted on

Get to Know N of MEAN Stack

Node.js

Node.js is a runtime environment to execute JavaScript code outside of a browser. Node.js is used to build and run the apps developed in JavaScript or any language that transpile to JavaScript.

Overview

Node.js allows JavaScript code to run outside of a browser context, i.e. running directly on a computer or server OS. It allows the backend APIs to communicate with the OS APIs such as file system libraries. It gives JavaScript the ability to act as a web server language.

Node.js is event-driven, i.e. flow of the program is based on user actions. So Node.js starts the server, performs the initial tasks, starts the event loop and then waits for the event to occur.

Node.js uses single threaded event loop to handle all the requests. Using the non-blocking I/O model, it comes up with the ability to handle a large number of concurrent requests without the need to manage thread concurrency.

Node.js provides access to an enormous number of reusable components through its package manager npm and enhances the developers’ power in this way.

Benefits

Node.js is:

  • Suitable for data-intensive apps.
  • Known for building efficient and highly scalable apps.
  • A good platform to serve real-time apps because of its great performance and reliable service.

Top comments (1)

Collapse
 
farhatsharifh profile image
Farhat Sharif

I would like your comments to understand more about Node.js