Member-only story

How NodeJS internally works?

chanduthedev
2 min readOct 6, 2023

--

In this article I am going to explain about how NodeJS works internally. I assume readers have some basic knowledge on NodeJS as I am not going discuss about basics on NodeJS.

As you know NodeJS runtime environment is asynchronous non-blocking system, it internally uses even-looping system to implement asynchronicity. Before going to event-looping, let’s check internal modules of Node.

  • NodeJS is written in C++ and JavaScript with Google V8 JavaScript Engine embedded in it
  • V8 will convert from JavaScript code to low/machine level code
  • V8 is written in C++ and its open source.
NodeJS internal structure
NodeJS internal structure

From the above picture, you can see Node has two parts.
1. JavaScript Part
-
JavaScript is synchronous
- It has JS native library code like util, crypto etc
- This will interact with NodeJS application and pass the data to V8 JS engine and other dependency modules if required

2. Dependencies Part
- It has many low level modules like V8, libuv, openssl
- V8 is one of the main dependency module
- Most of these dependency modules are written in C/C++
- V8 is synchronous

--

--

Responses (2)