Property Validator
Runtime type validation with TypeScript inference for JavaScript and TypeScript projects.
Overview
Property Validator provides schema-based runtime type validation with full TypeScript type inference. Validate data from any source - API responses, user input, config files, function arguments - with clear error messages and graceful failure.
Status: In Development (v0.1.0)
Language: TypeScript
Repository: tuulbelt/property-validator
Features
Schema-Based Validation
Define schemas once, get both runtime validation and TypeScript types automatically. No code duplication between runtime and compile-time types.
Graceful Error Handling
Returns result types ({ ok: true, value } or { ok: false, error }) instead of throwing exceptions. Your code stays resilient.
Clear Error Messages
Validation errors include exact paths to invalid fields, expected vs actual types, and helpful context for debugging.
Zero Runtime Dependencies
Uses only Node.js built-ins. No npm install required in production.
Quick Start
# Clone the repository
git clone https://github.com/tuulbelt/property-validator.git
cd property-validator
# Install dev dependencies (for TypeScript)
npm install
# Use in your project
import { v, validate } from './src/index.ts';
const UserSchema = v.object({
name: v.string(),
age: v.number(),
email: v.string()
});
const result = validate(unknownData, UserSchema);
if (result.ok) {
console.log(result.value); // TypeScript knows the exact type
} else {
console.error(result.error.message);
}Use Cases
- API Response Validation: Verify external API data matches expected schemas
- User Input Validation: Validate form data, CLI arguments, or configuration files
- Function Argument Validation: Add runtime checks to critical functions
- Data Transformation: Safely transform and validate data pipelines
- Component Props: Validate props at runtime in any framework (React, Vue, etc.)
Demo
See the tool in action:

▶ View interactive recording on asciinema.org
Why Property Validator?
Runtime Safety: TypeScript only checks types at compile-time. Property Validator ensures data from external sources (APIs, files, user input) matches your schemas at runtime.
Type Inference: Write schemas once, get TypeScript types automatically. No manual type definitions needed.
Framework Agnostic: Works anywhere JavaScript runs - not tied to React, Vue, or any specific framework.
Graceful Failure: Returns result types instead of throwing. Your app stays resilient to invalid data.
Next Steps
- Getting Started - Installation and basic usage
- CLI Usage - Command-line interface
- Library Usage - Import and use in your code
- Examples - Real-world validation scenarios
- API Reference - Complete API documentation