Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

os module in node js

const os = require("os");

console.log(os.arch());
console.log(os.hostname());
console.log(os.platform());
console.log(os.tmpdir());
console.log(os.type());

const freeMemory = os.freemem();
console.log(`Free Memory ::: ${freeMemory / 102 / 1024 / 1024}`);
const totalMemory = os.totalmem();
console.log(`TOTal Ram ::: ${totalMemory / 1024 / 1024 / 1024}`);
 
PREVIOUS NEXT
Tagged: #os #module #node #js
ADD COMMENT
Topic
Name
5+6 =