DHI

Validation at escape velocity.

Type-safe validation that won’t slow your hot paths. Transparent benchmarks and a tiny, intuitive API.

npm i dhi
pnpm add dhi
bun add dhi

Node 18+ • TypeScript 5+

Example on real hardware

50k items • all valid

Open playground
DHI12.4 ms
Zod41.3 ms
Median wall time3.3× faster
Batch-validated schema • client demo

Quickstart

ts
import { d, object, string, number } from 'dhi'

const User = object({
  id: number().int().positive(),
  email: string().email(),
  name: string().min(2),
})

// Parse or throw
const user = User.parse(input)

// Safe parse
const res = User.safeParse(input)
if (!res.success) {
  console.log(res.error.issues[0])
}

Average speedup

6.98× (range 1.07×–21.75×)

Fast paths

Optimized invalid-path checks for real-world inputs and heavy loads.

Type inference + DX

Tiny API surface with powerful composition and full type safety.

Small footprint

Lean runtime and bundle size; built for servers, safe for browsers.