Contact Us
AI · Accounting
Caelum AI — Document Processing

99% · Extraction accuracy

→
Flagship · GovTech
India Post — grievance system

Pan-India, awarded via GeM (Nov 2025).

Read →
Flagship · GovTech
India Post — grievance system

Pan-India, awarded via GeM (Nov 2025).

Read →
Global delivery
India · Belgium · UK

Three offices, three time zones.

→
npm package

TinyValidate validates forms and API payloads against typed schemas

A lightweight, TypeScript-first schema validation library for JavaScript and TypeScript — validate forms, API payloads and config with zero dependencies.

Get Started View on GitHub npm Package

How TinyValidate is designed

TinyValidate keeps schema validation small and easy to customize: typed schemas, built-in and custom rules, and no runtime dependencies.

Type safety

Use TypeScript’s type system to improve the development experience and enhance overall code reliability.

Zero dependencies

No external dependencies means a smaller bundle size, fewer security concerns, and faster installs.

Custom validation rules

Create custom validators or use built-in validation utilities to fit your application’s requirements.

Bundle size

Designed to remain lightweight and fast, making it suitable for both small and large-scale applications.

Features

  • Type-safe validation
  • Custom validation rules
  • Schema-based validation
  • Form field validation
  • Error handling utilities
  • Lightweight and dependency-free
  • Modern TypeScript support
  • Easy integration with React, Vue, Angular, and other frameworks

Use cases

  • User registration forms
  • Login and authentication workflows
  • Checkout and payment forms
  • Admin dashboards
  • Internal business applications
  • API request validation

Installation and usage

TinyValidate installs from npm and runs on Node.js 16 and later with no runtime dependencies.

Installation
npm install @mindrops/tinyvalidate

# or
pnpm add @mindrops/tinyvalidate

# or
yarn add @mindrops/tinyvalidate
Usage example
import { object, string, number } from "@mindrops/tinyvalidate";

// 1. Describe the shape of the value
const UserSchema = object({
  name: string().min(3).max(40),
  email: string().email(),
  age: number().min(18)
});

// 2. Validate without throwing
const result = UserSchema.safeParse(input);

// 3. Handle both outcomes
if (result.success) {
  console.log(result.data);    // typed { name, email, age }
} else {
  console.log(result.errors);  // [{ path, message, code }, ...]
}

A failed safeParse() reports every issue in one pass rather than stopping at the first. Where an exception is preferred, .parse() throws a ValidationError carrying the same issues, with .flatten() and .format() helpers for presentation.

Package details

Current version
0.1.2
Supported Node versions
Node.js 16 and later
License
MIT License
npm package
@mindrops/tinyvalidate
Module formats
ESM and CommonJS, with bundled types
Runtime dependencies
None

Documentation

The documentation covers installation, the API reference, examples and recommended practices.

Read Documentation

Contributing

TinyValidate is open source and welcomes contributions from the community. Feature requests, bug reports, and pull requests are encouraged.

Contribute on GitHub

Frequently asked questions

How do I install TinyValidate?
Run npm install @mindrops/tinyvalidate, or use pnpm add @mindrops/tinyvalidate or yarn add @mindrops/tinyvalidate.
Does TinyValidate work with React, Vue or Angular?
Yes. It integrates with React, Vue, Angular and other frameworks, and also suits API request validation. Need the application built around it? See custom web application development or hire React developers.
How does TinyValidate report validation errors?
A failed safeParse() reports every issue in one pass, each with a path, message and code. If you prefer exceptions, .parse() throws a ValidationError carrying the same issues, with .flatten() and .format() helpers for presentation.
Which Node.js versions and module formats are supported?
Node.js 16 and later, with ESM and CommonJS builds and bundled TypeScript types. The current version is 0.1.2.
What licence is TinyValidate released under, and where is the source?
The MIT License. The source and documentation are on GitHub at mindropsrepo/mindrops-tinyvalidate, where feature requests, bug reports and pull requests are encouraged.

About Mindrops

TinyValidate is maintained by Mindrops as part of its commitment to building practical open-source developer tools and modern JavaScript infrastructure.

Explore More Open Source Projects

We use essential cookies to run this site. Analytics and marketing cookies are optional. Cookie Policy