The os module provides operating system-related utility methods and properties. It can be accessed using:
const os = require('os');For example if want to retrieves the cpu information.
console.log(os.cpus());
//Output
{
model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
speed: 2926,
times: {
user: 252020,
nice: 0,
sys: 30340,
idle: 1070356870,
irq: 0
}
}

0 Comments