# alewin/useWorker

⚛️ useWorker() - A React Hook for Blocking-Free Background Tasks

Repository: https://github.com/alewin/useWorker
Canonical: https://ross.abutalabs.com/products/useworker
Homepage: https://useworker.js.org/
Language: JavaScript
License: MIT
License Family: permissive
Topics: react, hooks, web-worker-react, useworker, web-workers, background, thread, hook, web-worker, typescript-library
Last push: 2026-06-06T17:32:01+00:00

## Health v2 (maintenance only)
Score: 68/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 86, release rhythm 28, longevity 100
- inputs: {"age_days": 2419, "days_push": 88, "days_rel": 542, "gap_med": 65.5, "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 3113, forks 106 (observed 2026-08-28T04:07:44.030958+00:00)

## What it is
useWorker() is a small React hook library that lets you run expensive JavaScript functions in Web Workers without blocking the UI, using a Promise-based API instead of raw worker message events. It supports TypeScript, timeouts, remote dependencies, transferable objects, and automatic worker cleanup.

## Use cases
- sort large arrays without freezing the UI
- parse or generate CSV files in the background
- run CPU-intensive calculations off the main thread
- use web workers with a simple React hook syntax
- offload expensive functions from React components
- run external scripts inside a web worker

## When to choose
- you use React and need non-blocking background tasks
- you want a Promise-based alternative to raw Web Worker messaging
- you need a tiny (<3KB) worker abstraction with TypeScript support
- you want automatic worker lifecycle management with timeouts

## When to avoid
- your project does not use React
- your worker function needs DOM or window access
- you need to run the same worker concurrently while it is busy
- your function returns non-serializable values like functions

## Facets
- artifact type: library
- maturity: maintenance
- function: concurrency, developer-tools
- domain: web-development, frontend, developer-tools
- platform: browser
- tags: react-hook, web-workers, non-blocking-ui, typescript, promises, javascript, react

## Member repositories
- alewin/useWorker (main) score 68

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:44.030958+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-30T07:26:41.363689+00:00, confidence not recorded.
  - readme: https://github.com/alewin/useWorker (fetched 2026-08-28T04:07:44.030958+00:00, sha c86600e02471)
  - homepage: https://useworker.js.org/ (fetched 2026-08-29T09:42:04.406108+00:00, sha 4431efac54fa)
  - site_page: https://useworker.js.org/docs/introduction (fetched 2026-08-29T09:42:04.415672+00:00, sha 32cedf335454)
  - site_page: https://useworker.js.org/docs/installation (fetched 2026-08-29T09:42:04.418020+00:00, sha 22b0ff3db8b0)
  - site_page: https://useworker.js.org/docs/api-useworker (fetched 2026-08-29T09:42:04.420105+00:00, sha fdb118ab2bee)
  - site_page: https://useworker.js.org/docs/examples/examples-sort (fetched 2026-08-29T09:42:04.422209+00:00, sha 0003e5499b2e)
  - site_page: https://useworker.js.org/docs/limitations (fetched 2026-08-29T09:42:04.424481+00:00, sha 3e85550e4eb3)
- Data as of 2026-08-30T08:39:29.467469+00:00.
