Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

cpu-load

davidchubbs2691.0.0

Return the average CPU load across a spectrum of time

cpu load, cpu, cpu cores, os, ops

readme

CPU Load

License Dependency Status NPM version

No dependencies.

npm install cpu-load
let cpu = require('cpu-load')

// track the CPU load over the next 1 second
cpu(1000, function (load) {
  load //=> 0.03 (3%)
})

The CPU load is averaged across multi-core machines. No need to divide the cpu-load results against the number of cores.