Skip to content

v2.1 • Utils • 3kb gzipped • MIT

WorkerPool

Worker orchestration with transferables, backpressure and a promise-shaped API.

★ 9.8kGitHub
↓ 17.7k / week● MIT● TS 5.0+
workerpool-preview.png
Abstract preview graphic for WorkerPool

// why workerpool

Workers without the ceremony

Call a worker function and await it. Message plumbing, pooling and transferables are handled underneath.

● 0 deps● 3kb gzipped● tree-shakeable

// stack

Backpressure aware

A saturated pool queues rather than spawning until the tab falls over.

WorkerPool started as a single file in a client project and stayed small on purpose. It does one job, it does it in 3kb gzipped, and it has no runtime dependencies.

Getting started

Install it, import it, call it:

npm i workerpool-js

Call a worker function and await it. Message plumbing, pooling and transferables are handled underneath.

What it does not do

It does not manage your state, style your components or ship a plugin system. Those are your decisions, and keeping them out is what keeps the bundle honest.

  • Transferable detection
  • Queue with backpressure
  • MIT licensed, commercially friendly

Features

Transferable detection

Buffers are transferred instead of copied whenever it is safe to do so.

Queue with backpressure

Pool size adapts to hardware concurrency and holds the queue when saturated.

Documented properly

Every public function has a worked example, not just a signature.

ESM and types

Ships module and CommonJS builds with hand-written type definitions and source maps.

Tree-shakes cleanly

Every export is side-effect free, so importing one function costs one function.

Tested to the edges

Ninety-eight percent branch coverage, with the awkward cases written first.

Get WorkerPool v2.1

9 files • .min.js 3kb • .zip 42kb • sha384 verified

Changelog

v2.1 Nov 6 2025 • latest
  • Automatic transferable detection
  • Pool sizes to hardware concurrency
  • Cancellation via AbortSignal
v2.0.1 Aug 28 2025
  • Improved error messages for invalid options
  • Added twenty regression tests
v2.0 Jul 9 2025
  • Node 18 is now the minimum supported version
  • CommonJS build restored for older bundlers
View full archive →

// related

Related products

Sep 10 • v2.0

ChartForge

Canvas charts in twelve lines. Responsive, accessible and dark-mode ready, with no D3 learning curve.

View →
Aug 30 • v3.2.1

MotionEase

Physics-based micro-animations with a single call. Spring curves that feel right without a tuning session.

View →
Aug 19 • v1.9.4

FormFlow

Validation and multi-step logic that works the same in React, Vue and vanilla. Your markup stays yours.

View →

Drop it in this afternoon.

MIT licensed. Commercial friendly. Five-minute setup.