# inline-esm-worker

> A node.js worker_thread that runs once, can load modules and returns stdout

Latest version **0.0.4** (published 2021-10-30) · GPL-3.0-only license · 0 weekly downloads

## Install

```sh
npm install inline-esm-worker
pnpm add inline-esm-worker
yarn add inline-esm-worker
bun add inline-esm-worker
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2021-10-30 |
| First published | 2021-05-31 |
| Weekly downloads | 0 |
| License | GPL-3.0-only |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 38.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tim Daubenschütz |
| Maintainers | timdaub |
| Keywords | nodejs, worker, worker_threads, esm, inline |

## Links

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

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

- 0.0.4 (latest) — 2021-10-30
- 0.0.3 — 2021-06-07
- 0.0.2 — 2021-06-02
- 0.0.1 — 2021-05-31

## README

# inline-esm-worker

> A node.js worker_thread Worker that runs once, can load modules and
> returns stdout

## installation

```bash
$ npm i inline-esm-worker
```

## usage

```js
import run from "inline-esm-worker";

const script = `console.log("hello world")`;
const capturedStdout = await run(script);
> hello world
// capturedStdout is a buffer you can use for further evaluation of the script
```

**notes**:

- any errors thrown within the script input of `run` are propagated to the user
and are hence catchable.

## changelog

### 0.0.4

- URL encode code to prevent syntax errors

### 0.0.3

- Redirect worker's stdout to runtime of user

### 0.0.2

- `run(script)` is throwing errors that originate in running `script`.

### 0.0.1

- Initial release

## license

See LICENSE file

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