Display OS Memory Using NodeJS - Convert MB to GB
This simple code is to display a basic output from OS free memory using NodeJS, and then output it into the console.log() terminal, take note that I am using VS Code Here so if you wanted to try you can use that text editor or you can use your own.
Documentation of OS in Node can be found on their website which you can also go here. for the JS Source Code, you can get it here. (You will get the full functionality of it including the Functions that will convert the Megabytes into GigaBytes).
This Simple coding is just documentation for my NodeJS journey, and I also do JavaScript/ReactJs/Express Journey and also Laravel which will soon be displayed on this small basic blog site of mine.
Basic Code to Display OS.FreeMEM():
const os = require('node:os');
console.log(os);
const totalMemory = os.totalmem();
console.log(`TOTAL MEMORY: ${totalMemory} MB`);
0 comments:
Post a Comment