Offload functions to worker threads with shared memory primitives for Node.js.
8
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: require Node v24+, remove --experimental-strip-types from example run commands

Node 24 supports TypeScript type stripping natively. The flag is kept
in package.json test script for backward compatibility but removed
from example comments.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+8 -4
+2 -1
examples/atomics/main.ts
··· 1 1 // Shared memory between main thread and workers using int32atomic. 2 + // Requires Node v24+. 2 3 // 3 - // Run: node --experimental-strip-types examples/atomics/main.ts 4 + // Run: node examples/atomics/main.ts 4 5 5 6 import { pool, int32atomic } from '../../src/index.ts'; 6 7 import { increment } from './increment.ts';
+2 -1
examples/non-blocking/main.ts
··· 1 1 // Demonstrates that the main thread event loop stays responsive 2 2 // while heavy work runs on worker threads. 3 + // Requires Node v24+. 3 4 // 4 - // Run: node --experimental-strip-types examples/non-blocking/main.ts 5 + // Run: node examples/non-blocking/main.ts 5 6 6 7 import { pool } from '../../src/index.ts'; 7 8 import { fibonacci } from './fibonacci.ts';
+2 -1
examples/parallel-batch/main.ts
··· 1 1 // Process a batch of work items in parallel using a worker pool. 2 2 // Compares sequential (dedicated worker) vs parallel (pool) execution. 3 + // Requires Node v24+. 3 4 // 4 - // Run: node --experimental-strip-types examples/parallel-batch/main.ts 5 + // Run: node examples/parallel-batch/main.ts 5 6 6 7 import { pool } from '../../src/index.ts'; 7 8 import { heavyWork } from './heavy-work.ts';
+2 -1
examples/primes/main.ts
··· 1 1 // CPU-bound prime checking offloaded to a dedicated worker thread. 2 + // Requires Node v24+. 2 3 // 3 - // Run: node --experimental-strip-types examples/primes/main.ts 4 + // Run: node examples/primes/main.ts 4 5 5 6 import { isPrime } from './is-prime.ts'; 6 7