# runtypes/runtypes

Runtime validation for static types

Repository: https://github.com/runtypes/runtypes
Canonical: https://ross.abutalabs.com/products/runtypes
Language: TypeScript
License: MIT
License Family: permissive
Topics: typescript, runtime, types, validation
Last push: 2026-08-14T04:13:17+00:00

## Health v2 (maintenance only)
Score: 98/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 97, release rhythm 98, longevity 100
- inputs: {"age_days": 3758, "days_push": 19, "days_rel": 19, "gap_med": 5, "n_releases_24m": 6}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2697, forks 91 (observed 2026-08-28T04:07:11.238209+00:00)

## What it is
Runtypes is a TypeScript library for runtime validation of data against static types using composable validators for primitives, objects, arrays, tuples, unions, and more. It lets you safely check untyped external data (e.g., JSON) conforms to a type and derive static TypeScript types from the validators.

## Use cases
- validate JSON payloads from an API at runtime
- parse untrusted external data into typed TypeScript objects
- validate config files loaded at startup
- check data conforms to a discriminated union of object shapes
- derive static TypeScript types from runtime validators
- validate user input before processing

## When to choose
- you use TypeScript and want runtime checks that mirror your static types
- you want composable validators with detailed validation errors
- you prefer a lightweight validation library with a functional API

## When to avoid
- you need schema-based code generation or JSON Schema output
- you need high-performance validation of very large data volumes
- your project is not TypeScript/JavaScript

## Facets
- artifact type: library
- maturity: stable
- function: serialization, developer-tools
- domain: developer-tools, web-development, apis
- platform: bun, cross-platform
- tags: typescript, runtime-validation, type-safety, schema-validation, data-validation, nodejs, deno

## Member repositories
- runtypes/runtypes (main) score 98

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:11.238209+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-30T02:16:13.640658+00:00, confidence not recorded.
  - readme: https://github.com/runtypes/runtypes (fetched 2026-08-28T04:07:11.238209+00:00, sha 4023ec8d50e9)
  - registry_npm: https://registry.npmjs.org/runtypes (fetched 2026-08-29T09:59:38.154512+00:00, sha 8777fc94d3da)
- Data as of 2026-08-30T08:39:29.467469+00:00.
