Promise-based CPU Usage meter. No dependencies!
npm install @icebob/cpu
var cpu = require('@icebob/cpu');
cpu().then(({avg, usages}) => {
console.log(avg, usages);
});
Change sample time:
var cpu = require('@icebob/cpu');
cpu(500).then(({avg, usages}) => {
console.log(avg, usages);
});