# ianstormtaylor/superstruct

A simple and composable way to validate data in JavaScript (and TypeScript).

Repository: https://github.com/ianstormtaylor/superstruct
Canonical: https://ross.abutalabs.com/products/superstruct
Homepage: https://docs.superstructjs.org
Language: TypeScript
License: MIT
License Family: permissive
Topics: validation, types, interface, structs, schema, javascript, typescript
Last push: 2024-10-01T02:42:53+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 3205, "days_push": 701, "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 7134, forks 223 (observed 2026-08-28T04:09:56.138719+00:00)

## What it is
Superstruct is a JavaScript and TypeScript library for defining data schemas (structs) and validating arbitrary data against them at runtime. It offers a composable, TypeScript-inspired API with detailed error reporting, data coercion, and custom validators.

## Use cases
- validate request bodies in a REST or GraphQL API
- validate JSON data parsed from untrusted input
- define runtime-checked interfaces for TypeScript data
- coerce input data with default values before validation
- validate nested objects and arrays with custom validators
- check configuration files or environment data shapes

## When to choose
- you need runtime validation of arbitrary input in JavaScript or TypeScript
- you want detailed, human-readable validation errors
- you prefer a small, composable schema API inspired by TypeScript types
- you need to validate and coerce data with defaults

## When to avoid
- you only need compile-time type checking with no runtime validation
- you need extremely high-performance validation of huge datasets
- your team is standardized on another validator like Zod or Joi and interop matters

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

## Member repositories
- ianstormtaylor/superstruct (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:56.138719+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-29T17:40:03.072914+00:00, confidence not recorded.
  - readme: https://github.com/ianstormtaylor/superstruct (fetched 2026-08-28T04:09:56.138719+00:00, sha 315e20d2a0e3)
  - homepage: https://docs.superstructjs.org (fetched 2026-08-29T08:35:50.218790+00:00, sha 449af5074b11)
  - site_page: https://docs.superstructjs.org/guides/01-getting-started (fetched 2026-08-29T08:35:50.221415+00:00, sha fc2176dc4b55)
  - site_page: https://docs.superstructjs.org/resources/faq (fetched 2026-08-29T08:35:50.223155+00:00, sha 7803fe428772)
  - registry_npm: https://registry.npmjs.org/superstruct (fetched 2026-08-29T08:35:50.224840+00:00, sha 4ab251387d77)
- Data as of 2026-08-30T08:39:29.467469+00:00.
