NodeJS Architecture
The three main components of NodeJS Architecture are:
- V8
- libuv
- Node.js Bindings
The V8 Engine
it is an open-source JavaScript Engine which converts the source code into machine code. Instead of interpreting the js code line-by-line, the v8 engine directly converts the js code into machine code making the execution faster. The pipeline of the v8 engine are as follows:
Get Ifrah Sadiq’s stories in your inbox
Join Medium for free to get updates from this writer.
LIBUV
Libuv is a C library that give node.js asynchronous behavior. It handles all the asynchronous I/O operations. Libuv provides:
- Event Loop: continuously checks for any completed async tasks and executes callback if found.
- Async I/O handling: performs non-blocking operations.
- Thread Pool: even though js is a single threaded language, it has libuv as its main component. The libuv consists of multiple threads (4 by default) which it uses to execute async tasks independent on the OS kernel.
Node.js Bindings
Node.js bindings connect the js code running in v8 with the c/c++ libraries (libuv, os, native libraries, etc.). JavaScript cannot interact with the OS directly, there’s where the translator, bindings, comes in.




