# eval-worker

> This module evaluates a string in a Web Worker.

Latest version **1.0.8** (published 2018-10-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install eval-worker
pnpm add eval-worker
yarn add eval-worker
bun add eval-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.8 |
| Published | 2018-10-04 |
| First published | 2018-07-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Leonardo Sao Thiago |
| Maintainers | leoancap |
| Keywords | javascript, eval, vm, worker |

## Links

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

## Dependencies (1)

- [worker-loader](https://npm.io/package/worker-loader.md) ^2.0.0

## Alternatives

- [cron](https://npm.io/package/cron.md) — 4.9M weekly downloads
- [@vercel/queue](https://npm.io/package/@vercel/queue.md) — 731.6K weekly downloads
- [create-sonicjs](https://npm.io/package/create-sonicjs.md) — 1.6K weekly downloads
- [@exellix/jobs-api](https://npm.io/package/@exellix/jobs-api.md) — 941 weekly downloads
- [@forwardimpact/libskill](https://npm.io/package/@forwardimpact/libskill.md) — 575 weekly downloads

## Recent versions

- 1.0.8 (latest) — 2018-10-04
- 1.0.7 — 2018-08-15
- 1.0.6 — 2018-07-31
- 1.0.5 — 2018-07-31
- 1.0.3 — 2018-07-30
- 1.0.2 — 2018-07-30
- 1.0.1 — 2018-07-30
- 1.0.0 — 2018-07-30

## README

## Eval Worker

This module evaluates a string in a Web Worker.

### Example

```
const evalWorker = require("eval-worker")

evalWorker("2+3", 2000).then(result => {
  console.log(result) // 5
})
evalWorker("while(true){}", 2000).then(result => {
  console.log(result) // It is timed out after 2 seconds
})
```

### Usage with Webpack

You will need to install `worker-loader`

```
// webpack.config.js
{
  module: {
    rules: [
      {
       test: /worker\.js$/,
       include: paths.appNodeModules, // path to your node_modules folder
       use: {
         loader: "worker-loader"
       }
      }
    ]
  }
}
```

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