Sury is a composable schema validation and parsing library for JavaScript, TypeScript, and ReScript, currently at v11.0.0-alpha.7. It employs a JIT compilation approach using `new Function` to achieve the fastest validation performance in the ecosystem, as per benchmarks. The library offers over 100 operations, supports Standard Schema and JSON Schema, and has a modular, tree-shakable API similar to Valibot. It is released as an alpha with ongoing development.
npm install suryNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage of Sury's object schema and parse function with TypeScript types.
Ensure your runtime allows `new Function` or use a fallback schema library that does not rely on it.
Wait for stable release or pin to older versions if needed.
Enable 'nodejs_compat' flag in Cloudflare Workers or avoid using Sury in restricted runtimes.
Import only the specific functions you need (e.g., `import { S, parse, string } from 'sury'`).Review changelog before upgrading from v10 stable.
Switch to ES modules (import) or use dynamic import if CommonJS is required.
Use `import { S } from 'sury'` instead of `import S from 'sury'`.Import parse directly from 'sury' (e.g., `import { parse } from 'sury'`).