# sindresorhus/ow

Function argument validation for humans

Repository: https://github.com/sindresorhus/ow
Canonical: https://ross.abutalabs.com/products/ow
Homepage: https://sindresorhus.com/ow/
Language: TypeScript
License: MIT
License Family: permissive
Topics: validation, type-checking, nodejs, npm-package, javascript
Last push: 2025-10-16T17:10:13+00:00

## Health v2 (maintenance only)
Score: 59/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 47, release rhythm 52, longevity 100
- inputs: {"age_days": 3260, "days_push": 321, "days_rel": 321, "gap_med": 18.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 3865, forks 111 (observed 2026-08-28T04:08:27.654252+00:00)

## What it is
ow is a TypeScript library providing expressive, chainable runtime validation of function arguments and values with descriptive error messages. It includes built-in predicates for many types, custom validation support, and TypeScript type guards.

## Use cases
- validate function arguments at runtime
- validate environment variables and config at startup
- assert constructor parameters in classes
- validate CLI arguments and flags
- narrow TypeScript types from unknown values
- validate object shapes with descriptive errors

## When to choose
- you need runtime validation of function inputs with clear error messages
- you want self-documenting assertions with a chainable API
- you need TypeScript type guards after validation
- you want dev-only imports stripped from production bundles

## When to avoid
- you need complex schema validation for API responses or JSON parsing (use zod)
- you need validation outside the JavaScript/TypeScript ecosystem
- you need zero runtime overhead in production without using the dev-only shim

## Facets
- artifact type: library
- maturity: stable
- function: testing, developer-tools
- domain: developer-tools, web-development, programming-languages
- platform: browser, cross-platform
- tags: validation, type-checking, assertion, typescript, runtime-validation, type-guards, nodejs

## Member repositories
- sindresorhus/ow (main) score 59

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:27.654252+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:25:51.710098+00:00, confidence not recorded.
  - readme: https://github.com/sindresorhus/ow (fetched 2026-08-28T04:08:27.654252+00:00, sha eac678fe3b81)
  - homepage: https://sindresorhus.com/ow/ (fetched 2026-08-29T09:20:30.156568+00:00, sha 05372f11e388)
  - registry_npm: https://registry.npmjs.org/ow (fetched 2026-08-29T09:20:30.167701+00:00, sha 9ab9c61ac5da)
  - site_page: https://sindresorhus.com/ow/types/Predicates.html (fetched 2026-08-29T09:20:30.165783+00:00, sha be018cb06bf3)
- Data as of 2026-08-30T08:39:29.467469+00:00.
