/cpu

node module for cpu usage based on `os` module

Primary LanguageJavaScript

cpu NPM version

Promise-based CPU Usage meter. No dependencies!

Install

npm install @icebob/cpu

Usage

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);
});