
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
exec-workers
Advanced tools
💛 You can help the author become a full-time open-source maintainer by sponsoring him on GitHub.
npm i exec-workers
Create a worker.ts:
import { handleActions } from "exec-workers"
export const actions = {
async sum(a: number, b: number) {
await someHeavyOperation()
return a + b
},
}
export type Actions = typeof actions
handleActions(actions)
In your app.ts where you want to use the worker:
import { createWorker } from "exec-workers"
import { type Actions } from "./worker"
const worker = createWorker<Actions>(
// Require a bundler like Vite, webpack etc
() =>
new Worker(new URL("./worker.ts", import.meta.url), {
type: "module",
}),
)
const result = await worker.run("sum", 1, 2)
expect(result).toBe(3)
To use the worker.ts in an iframe instead of a web worker, you only need to return the iframe element in createWorker instead:
const iframe = createWorker<Actions>(
() => document.querySelector<HTMLIframeElement>("#your-iframe-element")!,
)
const result = await iframe.run("sum", 1, 2)
Errors thrown in the worker will be re-thrown when you call the .run method:
worker.run("some-problematic-action").catch((err) => {
// err is the error thrown in the worker
})
FAQs
Type-safe and Promisified API for Web Worker & Iframe
We found that exec-workers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.