Skip to content

Commit

Permalink
os module in node js
Browse files Browse the repository at this point in the history
  • Loading branch information
codingXpert committed Aug 1, 2022
1 parent 3f7220e commit 58e7902
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions os.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const os = require('os');

//to know system architecture
console.log(os.arch());

//to know RAM info
console.log(os.freemem());

//to convert this free memory in gb:-
console.log(os.freemem()/(1024*1024*1024));

// to know the total space/memory of RAM
console.log(os.totalmem()/(1024*1024*1024));

//to know pc name/host name
console.log(os.hostname());

// to know the plateform/os
console.log(os.platform());

//to know user info
console.log(os.userInfo());

0 comments on commit 58e7902

Please sign in to comment.