menu_book Course Curriculum (Node.js) expand_more
Runtime & Modules
Filesystem
Paths & URLs
Events & Buffers
HTTP
Async & Processes
Testing & Diagnostics
worker_threads
Learn worker_threads in Node.js with a dedicated explanation, a topic-specific example, edge guidance, and a mastery check.
12 min read
•
Intermediate
nodejs-048.js
javascript
import { Worker, isMainThread, parentPort } from "node:worker_threads"; if(isMainThread){const w=new Worker(new URL(import.meta.url)); w.on("message",console.log);} else parentPort.postMessage(21*2);
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content