# estimate-cores

> Estimate the number of processes that can be executed concurrently

Latest version **2.0.1** (published 2023-10-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install estimate-cores
pnpm add estimate-cores
yarn add estimate-cores
bun add estimate-cores
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: no vulnerabilities; has provenance; high maintenance score.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2023-10-29 |
| First published | 2014-09-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 18 \|\| >=20 |
| Dependencies | 1 |
| Unpacked size | 6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1 |
| Author | Kenan Yildirim |
| Maintainers | kenan |
| Keywords | browser, concurrency |

## Links

- npm: https://www.npmjs.com/package/estimate-cores
- Repository: https://github.com/kenany/estimate-cores
- Homepage: https://github.com/kenany/estimate-cores#readme
- Issues: https://github.com/kenany/estimate-cores/issues
- npm.io page: https://npm.io/package/estimate-cores

## Dependencies (1)

- [lodash.isfunction](https://npm.io/package/lodash.isfunction.md) ^3.0.9

## 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

- 2.0.1 (latest) — 2023-10-29
- 2.0.0 — 2023-09-29
- 1.0.2 — 2016-07-21
- 1.0.1 — 2015-02-02
- 1.0.0 — 2014-09-04

## README

# estimate-cores

Estimate the number of processes that can be executed concurrently. Useful if
you want to figure out how many Web Workers you can spin up. Just remember to
save a core for the main thread.

## Example

``` javascript
const estimateCores = require('estimate-cores');

estimateCores((error, coreCount) => {
  if (error) {
    // handle error
    return;
  }

  console.log(coreCount);
  // => 4
});
```

## Installation

``` bash
$ npm install estimate-cores
```

## API

``` javascript
const estimateCores = require('estimate-cores');
```

### `estimateCores([force=false], callback)`

Estimates the number of possible concurrent processes. The core count is cached
for future calls. To force a recount, pass `true` for `force`.

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