# developit/web-worker

Consistent Web Workers in browser and Node.

Repository: https://github.com/developit/web-worker
Canonical: https://ross.abutalabs.com/products/web-worker
Homepage: https://npm.im/web-worker
Language: JavaScript
License: Apache-2.0
License Family: permissive
Last push: 2025-01-31T18:09:24+00:00

## Health v2 (maintenance only)
Score: 36/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 4, release rhythm 40, longevity 100
- inputs: {"age_days": 2446, "days_push": 579, "days_rel": 579, "gap_med": 0.0, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1175, forks 57 (observed 2026-08-28T04:03:52.384385+00:00)

## What it is
A small npm library that provides a consistent Web Worker API across browsers and Node.js, implementing browser-style Workers on top of Node's worker_threads. In the browser it simply aliases the native Worker, so the same worker code runs in both environments.

## Use cases
- run web workers in node
- write worker code that works in browser and node
- use module workers in node
- share worker code between frontend and backend
- offload cpu-heavy work to a background thread in node
- test browser worker code in node

## When to choose
- you need the same Worker-based code to run in both Node.js and browsers
- you want DOM-style events and onmessage handlers in Node workers
- you need Module Workers ({type:'module'}) support in Node
- you're building an isomorphic npm module that spawns workers

## When to avoid
- you only target browsers and can use the native Worker directly
- you need deep control over Node worker_threads features like SharedArrayBuffer transfers or resource limits
- your build tooling or test framework can't resolve worker URLs relative to modules

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

## Member repositories
- developit/web-worker (main) score 36

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:52.384385+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-30T06:27:04.856121+00:00, confidence not recorded.
  - readme: https://github.com/developit/web-worker (fetched 2026-08-28T04:03:52.384385+00:00, sha 3648f3b8b9c3)
  - registry_npm: https://registry.npmjs.org/web-worker (fetched 2026-08-29T12:33:07.607614+00:00, sha 5dafce2374ab)
- Data as of 2026-08-30T08:39:29.467469+00:00.
