Skip to content

Repository files navigation

codecov NPM Version NPM Version GitHub Actions Workflow Status GitHub Actions Workflow Status

Schemify

Schemify is a modular, type-safe, and tree-shakable schema validation library designed for JavaScript and TypeScript. It allows you to build powerful validation schemas with minimal overhead, while ensuring dead code elimination for unused validators.

✨ Features

  • 📦 Tree-shakable — Unused validators are removed from the bundle.
  • 🧩 Modular design — Import only what you need.
  • 🛠 Type-safe — Infers TypeScript types from your schemas automatically.
  • 🔌 Extensible — Easily create and attach custom validators.
  • 🧪 Fully tested with Vitest.

📦 Installation

npm install @bytelab.studio/schemify
# or
yarn add @bytelab.studio/schemify

🚀 Usage

import * as Schema from "@bytelab.studio/schemify";

const schema = Schema.object({
    name: Schema.string(),
    age: Schema.number({min: 18})
});

type User = Schema.InferType<typeof schema>;

schema.validate({name: "Alice", age: 21}); // ✅ valid
schema.validate({name: "Bob", age: 15});   // ❌ throws

📚 Documentation

See Documentation for a list of all built-in validators grouped by module.

🧪 Testing

npm test

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A modular schema definition and validation framework inspired by Zod, Yup, and Valibot.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages