# YuzuJS/setImmediate

A cross-browser implementation of the new setImmediate API.

Repository: https://github.com/YuzuJS/setImmediate
Canonical: https://ross.abutalabs.com/products/setimmediate
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2024-01-01T07:03:03+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": 5543, "days_push": 975, "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 1302, forks 106 (observed 2026-08-28T04:04:18.138287+00:00)

## What it is
A cross-browser JavaScript library implementing the proposed setImmediate and clearImmediate APIs for efficient script yielding to the event loop. It uses environment-specific tricks (MessageChannel, postMessage, process.nextTick) with a setTimeout fallback so it works everywhere.

## Use cases
- yield to the browser event loop more efficiently than setTimeout(fn, 0)
- polyfill setImmediate in older browsers and Node versions
- schedule macrotask callbacks that let I/O and rendering happen between tasks
- avoid long-running script blocking in IE6+ and legacy browsers
- queue tasks in web workers

## When to choose
- you need macrotask semantics (yield to event loop) rather than microtask semantics
- you must support very old browsers or Node versions lacking native setImmediate
- you want a small, dependency-free shim with a safe setTimeout fallback

## When to avoid
- you only need microtask ordering — use Promise or asap instead
- you want render-loop-aligned scheduling — use requestAnimationFrame
- your target environments all have native setImmediate already

## Facets
- artifact type: library
- maturity: maintenance
- function: concurrency, developer-tools
- domain: web-development, frontend, developer-tools
- platform: browser, cross-platform
- tags: setimmediate, polyfill, shim, event-loop, macrotask, async, nodejs

## Member repositories
- YuzuJS/setImmediate (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:18.138287+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-30T04:51:16.305946+00:00, confidence not recorded.
  - readme: https://github.com/YuzuJS/setImmediate (fetched 2026-08-28T04:04:18.138287+00:00, sha 6b8504e6cef0)
  - registry_npm: https://registry.npmjs.org/setimmediate (fetched 2026-08-29T12:09:40.764220+00:00, sha 207b352e6140)
- Data as of 2026-08-30T08:39:29.467469+00:00.
