Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const cpuInfo = async () => {
const coreCount = cpu.count()
const cpuPercent = round(await cpu.usage())
let loadAverage = ''
cpu.loadavg().forEach((i) => (loadAverage += `${round(i)}% `))
return { cores: coreCount, percentage: cpuPercent, load: loadAverage.trim() }
}