Node.js Process Complete Reference
A process object is a global object that gives information about and controls the node.js process. As it is global, it can be used in the project without importing it from any module.
Example:
Javascript
// Node.js program to demonstrate the
// process.versions property
// Include process module
const process = require('process');
// Printing process.versions property value
// and variable count
let no_versions = 0;
// Calling process.versions property
const versions = process.versions;
// Iterating through all returned data
for (let key in versions) {
// Printing key and its versions
console.log(key + ":\t\t\t" + versions[key]);
no_versions++;
}
// Printing count value
console.log("Total no of values available = " + no_versions);
Output:
http_parser: 2.8.0
node: 10.16.0
v8: 6.8.275.32-node.52
uv: 1.28.0
zlib: 1.2.11
brotli: 1.0.7
ares: 1.15.0
modules: 64
nghttp2: 1.34.0
napi: 4
openssl: 1.1.1b
icu: 64.2
unicode: 12.1
cldr: 35.1
tz: 2019a
Total no of values available = 15
The Complete List of Processes is listed below:
Last Updated :
15 Mar, 2024
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...