Node.js module

worker_threads

The 'node:worker_threads' module enables multithreaded execution by spawning Worker threads that run JavaScript in isolated contexts.

Features include message passing, transferable objects, SharedArrayBuffer support, and performance measurement, allowing compute-intensive tasks to be offloaded from the main event loop.

Works in Bun · notes

Core worker creation and communication works. Several worker options (stdio, resourceLimits, etc.) and some advanced methods related to transferable objects and heap snapshots are not supported.

Functions 8

Classes 1

Interfaces 16

Types 3

Variables 12