Vex

Installation

Install @sylphx/vex in your project

Package Manager

npm install @sylphx/vex
pnpm add @sylphx/vex
yarn add @sylphx/vex
bun add @sylphx/vex

Requirements

  • 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:

tsconfig.json
{
  "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 }