Skip to content
Related Articles

Related Articles

Node.js v8.cachedDataVersionTag() Method

View Discussion
Improve Article
Save Article
  • Last Updated : 31 Jul, 2020
View Discussion
Improve Article
Save Article

The v8.cachedDataVersionTag() method is an inbuilt application programming interface of the v8 module which is used to get the version tag derived from the v8 version.

Syntax:

v8.cachedDataVersionTag();

Parameters: This method does not have any parameter.

Return Value: This method returns the version tag from the v8 version, command-line flags, and detected CPU features.

Below examples illustrate the use of v8.cachedDataVersionTag() method in Node.js.

Example 1: Filename: index.js




// Accessing v8 module
const v8 = require('v8');
  
// Calling v8.cachedDataVersionTag() 
tag = v8.cachedDataVersionTag();
console.log("cache data version tag is " + tag);


Run index.js file using the following command:

node index.js

Output:

cache data version tag is 4151506697

Example 2: Filename: index.js




// Accessing v8 module
const v8 = require('v8');
  
// User defined function
function getTagVersion() {
  
    // Initializing with zero 
    var tagVersion = 0;
  
    // Calling v8.cachedDataVersionTag() 
    tagVersion = v8.cachedDataVersionTag();
  
    return tagVersion;
}
  
// Function call
var result = getTagVersion();
  
// Printing Tag version
console.log("The Cache Data Version is:", result);


Run index.js file using the following command:

node index.js

Output:

The Cache Data Version is: 1165837633

Reference: https://nodejs.org/api/v8.html#v8_v8_cacheddataversiontag

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!