# cpus

> `os.cpus()` for node and the browser

Latest version **1.0.3** (published 2020-05-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install cpus
pnpm add cpus
yarn add cpus
bun add cpus
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2020-05-10 |
| First published | 2016-01-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 25 |
| Author | Feross Aboukhadijeh |
| Maintainers | feross |
| Keywords | browser, browserify, concurrency, cpu info, cpus, hardware concurrency, hardwareConcurrency, navigator.hardwareConcurrency, num cpus |

## Links

- npm: https://www.npmjs.com/package/cpus
- Repository: https://github.com/feross/cpus
- Homepage: http://feross.org
- Issues: https://github.com/feross/cpus/issues
- Funding: https://github.com/sponsors/feross
- npm.io page: https://npm.io/package/cpus

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2020-05-10
- 1.0.2 — 2018-06-09
- 1.0.1 — 2018-03-15
- 1.0.0 — 2016-01-11

## README

# cpus [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]

[travis-image]: https://img.shields.io/travis/feross/cpus/master.svg
[travis-url]: https://travis-ci.org/feross/cpus
[npm-image]: https://img.shields.io/npm/v/cpus.svg
[npm-url]: https://npmjs.org/package/cpus
[downloads-image]: https://img.shields.io/npm/dm/cpus.svg
[downloads-url]: https://npmjs.org/package/cpus
[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
[standard-url]: https://standardjs.com

#### `os.cpus()` for node and the browser

[![saucelabs][saucelabs-image]][saucelabs-url]

[saucelabs-image]: https://saucelabs.com/browser-matrix/cpus.svg
[saucelabs-url]: https://saucelabs.com/u/cpus

Returns an array of objects containing information about each CPU/core installed:
model, speed (in MHz), and times (an object containing the number of milliseconds the
CPU/core spent in: user, nice, sys, idle, and irq).

See the [node.js documentation](https://nodejs.org/api/os.html#os_os_cpus) for
`os.cpus()`.

In the browser, the `navigator.hardwareConcurrency` API is used, when available.

## install

```bash
npm install cpus
```

## usage

```js
var cpus = require('cpus')
console.log(cpus().length) // 4
```

## license

MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org).

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