sinclairzx81/typebox
TypeBox is a TypeScript library that provides a runtime type system for building JSON Schema objects with static type resolution, enabling unified type checking and runtime data validation.
Core Features
Quick Start
npm install typeboxDetailed Introduction
TypeBox is a runtime type system for TypeScript that bridges the gap between static type checking and runtime data validation. It allows developers to define types using a fluent API, which then generate standard JSON Schema objects. Crucially, these generated schemas can also infer precise TypeScript types, ensuring consistency across compile-time and runtime. This unified approach simplifies data validation, especially for data received over networks in services like REST or RPC, by leveraging the robustness of JSON Schema while maintaining TypeScript's type safety.