# cluster-wrap

> nodejs cluster wrapper. fork of throng, few minor tweaks

Latest version **1.2.5** (published 2017-08-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install cluster-wrap
pnpm add cluster-wrap
yarn add cluster-wrap
bun add cluster-wrap
```

## 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.2.5 |
| Published | 2017-08-22 |
| First published | 2016-10-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | victusfate |
| Maintainers | victusfate |
| Keywords | cluster, thread |

## Links

- npm: https://www.npmjs.com/package/cluster-wrap
- Repository: https://github.com/victusfate/cluster-wrap
- Homepage: https://github.com/victusfate/cluster-wrap#readme
- Issues: https://github.com/victusfate/cluster-wrap/issues
- npm.io page: https://npm.io/package/cluster-wrap

## Recent versions

- 1.2.5 (latest) — 2017-08-22
- 1.1.5 — 2017-08-22
- 1.1.4 — 2017-08-22
- 1.0.4 — 2016-10-30
- 1.0.3 — 2016-10-30
- 1.0.2 — 2016-10-30
- 1.0.1 — 2016-10-30
- 1.0.0 — 2016-10-30

## README

cluster-wrap
===

light wrap around nodejs cluster  
fork of throng https://github.com/hunterloftis/throng  
grabbed emitter handling/proxying  
removed lodash dependency  
removed lifetime functionality  


example usage:

    const clusterWrap = require('cluster-wrap');

    function worker(workerId) {
      console.log({ action: 'worker', workerId: workerId });
      // do some worker stuff    
    }

    function master() {
      console.log({ action: 'master' });
      // do some master stuff    
    }

    const concurrency = require('os').cpus().length;
    clusterWrap({
      worker  : worker,      // required worker function
      workers : concurrency, // optional, default ncpus
      master  : master       // optional, default () => {}
    })

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