Node JS-V8 Engine(Captain V8: The first Server side Avenger) Chapter 2

Vivek Bhati
3 min readAug 13, 2024

--

🩰°˖𓍢ִ໋🌷͙֒✧°.🎀༘⋆ Movie starts here : 🩰°˖𓍢ִ໋🌷͙֒✧°.🎀༘

V8 is just to convert the JS code into machine understandable code.

🩰°˖𓍢ִ໋🌷͙֒✧°.🎀༘⋆ Movie Ends here: 🩰°˖𓍢ִ໋🌷͙֒✧°.🎀༘

Now you might be surprised, what am I talking here. but yes that’s the main topic here. Everyone thinks that V8 is node JS, but let me correct you here. V8 is just one component of Node JS which is used to compile the Node JS program into machine understandable code. It is just a compiler.

💡 And here is the Suspense : V8 is written in C++

Yes you heard me right again, V8 is just C++ program which works as compiler for JavaScript. So in technical terms 👇

V8 is a crucial component of Node.js, but it is not the only component. Node.js is composed of several key components and technologies that work together to provide the platform’s functionality.

V8 JavaScript Engine

  • Role: V8 is the JavaScript engine that Node.js uses to execute JavaScript code. It is responsible for compiling JavaScript into native machine code, which allows for high performance.
  • Functionality: V8 handles the execution of JavaScript code, garbage collection, and optimizing performance. It’s the engine that powers both Google Chrome and Node.js.

While V8 is a critical part of Node.js, responsible for executing JavaScript code, Node.js is much more than just V8.

It includes a combination of the

👉 V8 engine

👉libuv for non-blocking I/O (handle Asynchronous Operations by using event loops)

👉 a rich core library

  • http: For creating web servers.
  • fs: For interacting with the file system.
  • path: For working with file and directory paths.
  • crypto: For encryption and security.

👉 C++ bindings for performance

C++ bindings in Node.js are used to connect high-level JavaScript code with low-level system operations, providing a bridge between the two. This approach is primarily used for performance reasons, allowing developers to write parts of the Node.js core or custom modules in C++ where performance is critical.

For Example: you can write a C++ program and configure it with Node JS as shown below “addon” is a C++ program file which is being used in Node JS.

👉 and a vast ecosystem of packages managed through NPM.

There are many more components, but above are few example of components which work together to make Node.js a powerful and versatile platform for building scalable, high-performance applications.

Check out below Node JS dependency over GitHub Repository so see V8 component here.

Let’s keep it short and interesting.

Next Chapter will be released soon, To know about the Node JS history check out Chapter 1

--

--

Vivek Bhati

Full Stack Developer Predominantly working in React, Redux, Node.