Reputation: 105
Is it possible to check actual RAM usage on a device with nodejs?
Upvotes: 1
Views: 388
Reputation: 5148
For System, you can check this out
https://www.npmjs.com/package/node-os-utils
var osu = require('node-os-utils')
var mem = osu.mem
mem.info()
.then(info => {
console.log(info)
})
It will log below information
{ totalMemMb: 16384,
usedMemMb: 13403.41,
freeMemMb: 2980.59,
freeMemPercentage: 18.19 }
Similarly, you can do for CPU and device and can run a custom command as well.
Upvotes: 2