JSPM

@bytelab.studio/schemify

1.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q61830F
  • License MIT

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

Package Exports

  • @bytelab.studio/schemify

Readme

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.