preveen-stack / nodejs

0 stars 0 forks source link

get the environment in nodejs #5

Open preveen-stack opened 7 months ago

preveen-stack commented 7 months ago
sh-3.2$ cat environ.js 
const os = require('os');
const { platform, arch, version, versions } = process;

console.log(`Operating System: ${os.type()} ${os.release()} (${platform}, ${arch})`);
console.log(`Node.js Version: ${version}`);
console.log(`V8 Version: ${versions.v8}`);
console.log(`OpenSSL Version: ${versions.openssl}`);
console.log(`${versions}`);
// Add any other relevant libraries or system information you want to print out
sh-3.2$ node environ.js 
Operating System: Darwin 23.4.0 (darwin, x64)
Node.js Version: v21.7.3
V8 Version: 11.8.172.17-node.20
OpenSSL Version: 3.2.1
[object Object]