How to use the node-os-utils.cpu.loadavg function in node-os-utils

To help you get started, we’ve selected a few node-os-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github callmekory / nezuko / src / commands / utils / SystemInfo.ts View on Github external
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() }
    }

node-os-utils

An operating system utility library.

MIT
Latest version published 3 years ago

Package Health Score

50 / 100
Full package analysis