Skip to main content

Modern validations for modern apps

Declarative validations
inspired by unit testing

Declarative validations framework inspired by unit testing libraries

Install with npm
npm i vest
import vest, { test, enforce } from 'vest';

const suite = vest.create('signup', () => {
  test('password', 'Must be strong', () => {
    enforce(password).longerThanOrEquals(8);
  });
});

Vest is a form validations framework that looks and feels like a unit testing framework.
It allows you to express your validation logic in a simple and readable way that's also easy to maintain in the long run.


test("username", "Username is required", () => {
enforce(data.username).isNotBlank();
});

test("username", "Username must be at least 3 chars", () => {
enforce(data.username).longerThanOrEquals(3);
});

test('username', 'Username already taken', async () => {
await doesUserExist(data.username);
});

Why Vest

Validation that feels like testing

Design suites the way you design specs: readable, declarative, and ready to ship across any frontend stack.

💡

Easy to learn

Vest mirrors the syntax of unit testing frameworks, so you write validations with familiar describe/test ergonomics.

🎨

Framework agnostic

Use Vest with any UI stack you like. It stays focused on validation logic while you bring your own components.

🧠

Smart runtime

Async handling, state management, and dependency-aware reruns are built in so validations stay fast and predictable.

🧩

Extensible

Craft custom validation types and behaviors that fit your domain without fighting the framework.

♻️

Reusable

Share validation logic across forms and features to keep your UX consistent and maintainable.

🐜

Tiny footprint

Zero dependencies and a few kilobytes of code keep bundles lean and pages speedy.