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.
- 📦 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.
npm install @bytelab.studio/schemify
# or
yarn add @bytelab.studio/schemifyimport * 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}); // ❌ throwsSee Documentation for a list of all built-in validators grouped by module.
npm testThis project is licensed under the MIT License - see the LICENSE file for details.
