# andywer/threads.js

🧵 Make web workers & worker threads as simple as a function call.

Repository: https://github.com/andywer/threads.js
Canonical: https://ross.abutalabs.com/products/threadsjs
Homepage: https://threads.js.org/
Language: TypeScript
License: MIT
License Family: permissive
Topics: javascript, nodejs, thread-pool, web-worker, isomorphic-javascript, multithreading, worker-threads, worker-pool, typescript
Last push: 2024-06-19T16:53:00+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4026, "days_push": 805, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3531, forks 173 (observed 2026-08-28T04:08:08.922791+00:00)

## What it is
threads.js is a TypeScript library that provides a uniform API for spawning and communicating with workers, using web workers in browsers and worker_threads in Node.js. It supports async functions, observables, and thread pools so CPU-intensive tasks can be offloaded with a simple function-call style API.

## Use cases
- offload CPU-intensive calculations to worker threads in node.js
- run the same worker code in browsers and node.js
- manage bulk task execution with a thread pool
- keep the UI responsive by moving business logic off the main thread
- use web workers with webpack bundling
- call worker functions as if they were local async functions

## When to choose
- you need multithreading that works identically in node.js and the browser
- you want a simple, typed API over raw worker_threads or web workers
- you need thread pools for dispatching many parallel tasks
- your build uses webpack and you want workers bundled transparently

## When to avoid
- your workload is I/O-bound rather than CPU-bound (async I/O suffices)
- you need fine-grained control over shared memory or SharedArrayBuffer
- you only target modern node.js and prefer the native worker_threads API directly

## Facets
- artifact type: library
- maturity: stable
- function: concurrency, developer-tools
- domain: developer-tools, web-development, cross-platform
- platform: browser
- tags: worker-threads, web-workers, thread-pool, multithreading, isomorphic, nodejs, electron, typescript, javascript

## Member repositories
- andywer/threads.js (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:08.922791+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:35:06.115316+00:00, confidence not recorded.
  - readme: https://github.com/andywer/threads.js (fetched 2026-08-28T04:08:08.922791+00:00, sha 601031c32f9a)
  - homepage: https://threads.js.org/ (fetched 2026-08-29T09:29:15.408788+00:00, sha 121240efb89d)
  - site_page: https://threads.js.org/getting-started (fetched 2026-08-29T09:29:15.418155+00:00, sha ec5d1ca0c394)
  - site_page: https://threads.js.org/usage (fetched 2026-08-29T09:29:15.420753+00:00, sha 8477f1969720)
- Data as of 2026-08-30T08:39:29.467469+00:00.
