NodeJS
NodeJS
With Node.JS
var os = require('os');
// return the cpu architecture
console.log("CPU architecture: " + os.arch());
// It returns the amount of free system memory in bytes
console.log("Free memory: " + os.freemem());
// It return total amount of system memory in bytes
console.log("Total memory: " + os.totalmem());
// It returns the list of network interfaces
console.log('List of network Interfaces: ' + os.networkInterfaces());
// It returns the operating systems default directory for temp files.
console.log('OS default directory for temp files : ' + os.tmpdir ());
os module common methods
arch()Returns the operating system CPU architecture
cpus()Returns an array containing information about the computer's
CPUs
freemem()Returns the number of free memory of the system
hostname()Returns the hostname of the operating system
loadavg()Returns an array containing the load averages, (1, 5, and
15 minutes)
platform()Returns information about the operating system's
platform
tmpdir()Returns the operating system's default directory for
temporary files
totalmem()Returns the number of total memory of the system
type()Returns the name of the operating system
uptime()Returns the uptime of the operating system, in seconds
userInfo()Returns information about the current user