# cpu-usage

> calculate cpu usage (for linux)

Latest version **0.1.0** (published 2012-02-24) · 0 weekly downloads

## Install

```sh
npm install cpu-usage
pnpm add cpu-usage
yarn add cpu-usage
bun add cpu-usage
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2012-02-24 |
| First published | 2012-02-24 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Andrei Husanu |
| Maintainers | husanu |

## Links

- npm: https://www.npmjs.com/package/cpu-usage
- Repository: https://github.com/husanu/nodejs-cpu-usage
- npm.io page: https://npm.io/package/cpu-usage

## Recent versions

- 0.1.0 (latest) — 2012-02-24

## README

# Nodejs Cpu Usage (for linux)

Module read file /proc/stat and calculate Cpu Usage.

Declaration:

```
/*
 * frequency - how often CpuLoad will be calculated (optional, default = 1000 (= 1 second))
 * callback - function that will be called when a new value is calculated for CpuLoad 
 */

function cpuUsage( [ frequency, ] callback );
```

Eg of use:

```
var libCpuUsage = require( './cpuusage.js' );

libCpuUsage( 1000, function( load ) {
	process.stdout.write( "\r" + load + "%   " );
} );
```

---
_Source: https://npm.io/package/cpu-usage · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
