🏠 This is the publish-only mirror of SchemasJS.
Source code, issues, pull requests, and discussions live on Codeberg. This GitHub repository exists only to publish npm packages via OIDC trusted publishing (which doesn't currently support Codeberg / Woodpecker).
SchemasJS is to runtime validation schemas what DefinitelyTyped is to TypeScript type definitions — a collection of ready-to-use, community-maintained schemas organized by validator library.
Choose your validator (Valibot, Zod, etc.) and get production-ready schemas for common needs — numeric types, binary protocols, typed arrays, and more. Each schema ships with its inferred TypeScript type, so you write once and get full type safety.
| Package | Description | Version |
|---|---|---|
@schemasjs/valibot-numbers |
C-style numeric schemas (Uint8, Int32, Float64…) |
| Package | Description | Version |
|---|---|---|
@schemasjs/zod-numbers |
C-style numeric schemas (Uint8, Int32, Float64…) |
| Package | Description | Version |
|---|---|---|
@schemasjs/validator |
Validator-agnostic wrapper — write schema-based logic once, swap the underlying validator later |
Schemas are tightly coupled to their validator library — a Valibot schema won't work with Zod, and vice versa. @schemasjs/validator provides a thin abstraction layer with a unified API (is(), parse(), safeParse()) so your application code doesn't need to know which validator sits underneath. Define your schemas, wrap them, and swap validators without touching business logic.
import { ValibotValidator, ZodValidator } from '@schemasjs/validator'
// These work identically regardless of the underlying validator
const uint8 = ValibotValidator<Uint8>(Uint8Schema)
uint8.is(255) // true
uint8.parse(42) // 42