Skip to main content

Gets the current process information in node.js

var util = require('util');

console.log('-------------------------------------------------');
console.log('            NODE.JS PROCESS INFO                 ');
console.log('-------------------------------------------------');
console.log('Current directory ........... ' + process.cwd());
console.log('Exec path ................... ' + process.execPath);
console.log('Current uid ................. ' + process.getuid());
console.log('Node version ................ ' + process.version);
console.log('Platform .................... ' + process.platform);
console.log('Memory usage ................ ' + util.inspect(process.memoryUsage()));

// *************************************************
// EXAMPLE CONSOLE OUTPUT
// *************************************************
// $ > node getprocessinfo.js
// -------------------------------------------------
//             NODE.JS PROCESS INFO                 
// -------------------------------------------------
// Current directory ........... /Users/jon/nodes
// Exec path ................... /opt/local/bin/node
// Current uid ................. 501
// Node version ................ v0.4.8
// Platform .................... darwin
// Memory usage ................ { rss: 14016512,
//   vsize: 3113324544,
//   heapTotal: 5510272,
//   heapUsed: 2638368 }