# zertosh/invariant

invariant

Repository: https://github.com/zertosh/invariant
Canonical: https://ross.abutalabs.com/products/invariant
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2021-12-14T00:53:36+00:00

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

## Adoption (not part of the score)
Stars 1230, forks 71 (observed 2026-08-28T04:04:04.053364+00:00)

## What it is
A tiny JavaScript library mirroring Facebook's `invariant` helper that throws descriptive errors in development and generic errors in production. It is widely used as a dependency in React ecosystem packages.

## Use cases
- assert a condition is true and throw otherwise
- provide detailed error messages in dev but generic ones in production
- strip error messages from production bundles via minification
- validate function arguments in libraries

## When to choose
- you need a tiny, battle-tested assertion helper compatible with browserify/envify
- you want dev-only descriptive errors that minify away in production

## When to avoid
- you want rich assertion APIs with many matchers (use chai or assert)
- you need TypeScript-native assertion functions with type narrowing

## Facets
- artifact type: library
- maturity: maintenance
- function: error-handling, testing
- domain: developer-tools, web-development
- platform: browser, cross-platform
- tags: assertions, invariant-condition, minification-friendly, facebook-mirror, javascript, nodejs

## Member repositories
- zertosh/invariant (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:04.053364+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:15:04.381164+00:00, confidence not recorded.
  - readme: https://github.com/zertosh/invariant (fetched 2026-08-28T04:04:04.053364+00:00, sha d31e0314d892)
  - registry_npm: https://registry.npmjs.org/invariant (fetched 2026-08-29T12:22:24.059852+00:00, sha 368e29bcca93)
- Data as of 2026-08-30T08:39:29.467469+00:00.
