# os-utils

> an operating-system utility library

Latest version **0.0.14** (published 2012-10-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install os-utils
pnpm add os-utils
yarn add os-utils
bun add os-utils
```

## Health

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

Positive: has types package; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.14 |
| Published | 2012-10-30 |
| First published | 2012-08-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/os-utils) |
| Module format | CommonJS |
| Node | * |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 248 |
| Author | Oscar Mejia |
| Maintainers | oscmejia |
| Keywords | os, operating system, server, memory, cpu, monitor, stats, harddrive |

## Links

- npm: https://www.npmjs.com/package/os-utils
- Repository: https://github.com/oscmejia/os-utils
- npm.io page: https://npm.io/package/os-utils

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 0.0.14 (latest) — 2012-10-30
- 0.0.13 — 2012-10-23
- 0.0.12 — 2012-10-17
- 0.0.11 — 2012-10-16
- 0.0.10 — 2012-10-16
- 0.0.9 — 2012-08-07
- 0.0.6 — 2012-08-02
- 0.0.4 — 2012-08-02
- 0.0.3 — 2012-08-02
- 0.0.2 — 2012-08-02
- 0.0.1 — 2012-08-02

## README

os-utils
========

an operating-system utility library. Some methods are wrappers of Node libraries
and others are calculation made by the module.


## Instalation

One line instaltion with [npm](http://npmjs.org). 

	npm install os-utils

Then in your code 
	
	var os 	= require('os-utils');


	os.cpuUsage(function(v){
		console.log( 'CPU Usage (%): ' + v );
	});

	os.cpuFree(function(v){




## Usage

The follwoing methods are available:


### Calculate CPU usage in the next second. This is not an average of CPU usage like in the "os" module. The callback will receive a parameter with the value

	os.cpuUsage( callback );
	

### Calculate free CPU in the next second. This is not based on average CPU usage like in the "os" module. The callback will receive a parameter with the value

	os.cpuFree( callback );

	
### Get the platform name

	os.platform();


### Get number of CPU

	os.countCPUs()


### Get current free memory

	os.freemem()


### Get total memory

	os.totalmem()


### Get a percentage reporesentinf the free memory

	os.freememPercentage()


### Get the number of miliseconds that the system has been running for.

	os.sysUptime();
	
	
### Get the number of miliseconds that the process has been running for.

	os.processUptime() 


### Get average load for the 1, 5 or 15 minutes

	os.loadavg(1)
	os.loadavg(5)
	os.loadavg(15)

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