totalmem method of OS module of node.js


Overview

This method is used to get the total amount of system memory in bytes.
This method returns Integer . Code snippet is given below:

Code


													
//Name of the file: totalmem.js
var os = require('os');
var value =  os.totalmem();
console.log("os.totalmem() => " + value);			
													
												

Run

  • Now run the snippet using the following command :
    													
    >node totalmem.js
    os.totalmem() => 1948631040