io-ts is a TypeScript runtime type system for decoding, validating, and encoding data at application boundaries. It solves a common TypeScript limitation: static types disappear at runtime, but external inputs still need to be checked safely. The library lets developers define codecs that represent both runtime validation logic and static TypeScript types. This approach is especially useful for APIs, configuration files, JSON payloads, database results, and any data that enters a program from an unknown source. io-ts integrates closely with functional programming patterns and the fp-ts ecosystem. Its main value is helping TypeScript applications keep runtime data validation aligned with compile-time type inference.
Features
- Runtime type validation for TypeScript
- Codec-based decoding and encoding
- Static type inference from runtime definitions
- Custom type guard support
- Functional programming integration with fp-ts
- Useful for APIs, JSON, configs, and external data