Node.js is based on V8 JavaScript engine, which provides high-performance JavaScript execution. Developed by Google, V8 continuously evolves, introducing performance optimizations and supporting new ECMAScript features with each update. Knowing which version of V8 is bundled with the Node.js installation is crucial for developers who want to ensure compatibility with modern JavaScript features, optimize performance, or debug issues effectively. This tutorial explains how to check which V8 JavaScript engine version is bundled in Node.js.
1. 'p' option via command line
The -p
option in Node.js allows you to evaluate an expression directly from the command line. To check the V8 version, you can use the following command:
node -p process.versions.v8
Output example:
11.3.244.8-node.14
2. 'process.versions.v8' property
If you're working within a script, you can access the V8 version programmatically using the process.versions.v8
property. Here's how you can do it:
const version = process.versions.v8;
console.log(version);
Leave a Comment
Cancel reply