Installation
Install @sylphx/vex in your project
Package Manager
npm install @sylphx/vexpnpm add @sylphx/vexyarn add @sylphx/vexbun add @sylphx/vexRequirements
- TypeScript >= 5.0.0 (peer dependency)
- Node.js >= 18.0.0
- ESM - Vex is an ESM-only package
TypeScript Configuration
Vex requires the following TypeScript settings for optimal type inference:
{
"compilerOptions": {
"strict": true,
"moduleResolution": "bundler" // or "node16", "nodenext"
}
}Verify Installation
import { str, num, object } from '@sylphx/vex'
const schema = object({
name: str(),
age: num(),
})
console.log(schema({ name: 'Alice', age: 30 }))
// { name: 'Alice', age: 30 }