@jimp/worker
Run Jimp off the main thread, in web workers and Node.js worker threads.
Jimp is written in JavaScript, so decoding, editing and encoding block the
thread they run on. `@jimp/worker` sends that work to a pool of workers as
plain data: an image, a list of edits in the format `image.apply` takes, and
what to send back.
```ts
// jimp.worker.ts
import { Jimp } from "jimp";
import { expose } from "@jimp/worker";
const exposed = expose(Jimp);
export type JimpWorkerApi = typeof exposed;
```
```ts
// main.ts
import { createJimpWorker } from "@jimp/worker";
import type { JimpWorkerApi } from "./jimp.worker";
const jimp = createJimpWorker