node:worker_threads for offloading work to separate JavaScript
contexts. The API is the standard Node one — Worker, parentPort, workerData,
postMessage, terminate — so existing worker code and libraries like
jest-worker run unmodified.
Workers are a
node-compat feature: node:worker_threads is
part of the Node surface and is withdrawn in strict-web.The cooperative-isolate model
Under the hood, meow’s workers are distinct V8 isolates that interleave cooperatively on the same OS thread, driven by the runtime’s event loop — not OS threads. This is a deliberate design choice. V8 isolates can’t move between OS threads, so rather than pay the context-switching tax of true OS threads, meow spawns each worker as a task on the main thread’s executor. They share nothing but the message channel, get genuine memory isolation, and interleave without thread overhead — ideal for the bursty, message-driven parallelism that bundlers and test runners use.Example
What’s supported
| Feature | Status |
|---|---|
new Worker(specifier, { workerData }) | ✅ |
worker.postMessage() / worker.on("message") | ✅ (structured-clone serialized) |
parentPort.postMessage() / parentPort.on("message") | ✅ |
workerData | ✅ |
worker.terminate() | ✅ (terminates the isolate) |
| Error propagation worker → host | ✅ (surfaces as an Error) |
| Nested workers (a worker spawning its own worker) | ⚠️ inert for now |
Next: environment variables
Every MEOW_* variable and how process.env behaves per mode.