@the-link/worker
v0.1.0
Published
Browser and Node.js Worker adapters for The Link.
Readme
The Link Worker
Worker communication adapters for The Link.
Install
npm install @the-link/workerBrowser
import { BrowserWorker } from "@the-link/worker/browser"
const link = new BrowserWorker(worker)BrowserWorker accepts a browser Worker or MessagePort-compatible target.
Node.js
import { Worker } from "node:worker_threads"
import { NodeWorker } from "@the-link/worker/node"
const worker = new Worker(new URL("./worker.js", import.meta.url))
const link = new NodeWorker(worker)NodeWorker accepts a Node.js Worker or MessagePort-compatible target.
Both adapters send [event, ...values] directly through postMessage(). The
runtime applies structured cloning. Calling disconnect() detaches the Link;
it does not terminate the Worker or close its port.
Development
bun install --frozen-lockfile
bun run verifyLicense
MIT
