# run-in-worker

> A small module that enable running functions on (html5) worker

Latest version **1.0.2** (published 2016-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install run-in-worker
pnpm add run-in-worker
yarn add run-in-worker
bun add run-in-worker
```

## 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.2 |
| Published | 2016-11-19 |
| First published | 2016-11-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Adi Biton |
| Maintainers | adibiton |

## Links

- npm: https://www.npmjs.com/package/run-in-worker
- npm.io page: https://npm.io/package/run-in-worker

## Recent versions

- 1.0.2 (latest) — 2016-11-19
- 1.0.1 — 2016-11-19
- 1.0.0 — 2016-11-19

## README

#run-in-worker
A util function that transfer execution of function to a web worker

###How to install
```
npm i run-in-worker -S
```

###How to use
```javascript
var worker = require('run-in-worker');
function add(a, b){
    return a + b;
}

var bgAdd = worker.createBGTask(add);

console.log('Adding on main thread, 3 + 7 = ', add(3,7));
console.log('Adding on web worker thread, 3 + 7 = ', bgAdd(3,7));
```

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