Search for a command to run...
Lightweight runtime schema validation library for JavaScript and TypeScript. Lets you define data shapes with a type-like API inspired by TypeScript, Flow, Go, and GraphQL, then validate arbitrary input and receive detailed errors instead of silent failures.
Created by the author of Slate.js. Stands out for its minimal footprint and composable design: structs nest cleanly, and custom validators plug in via a simple define API. Compared to heavier alternatives like Zod or Yup, it keeps the surface area small while covering the common cases.
Key capabilities:
Developers use Superstruct to validate request payloads in REST or GraphQL APIs, sanitize external input, and enforce schemas on internal data structures. Fits well with API layers, form handling, and any place where runtime guarantees matter beyond compile-time types.