Skip to content

IdoBouskila/emetify

Repository files navigation

Emetify

Emetify (Emet + verify 😉) is a type-safe schema validator inspired by Zod.
Since it's written for learning, it only has the core features of Zod.

Installation

To install, simply run the following command:

npm install emetify

Usage

Here's a quick example of the usage:

const { e } from 'emetify';

const schema = e.object({
    name: e.string().min(3).max(20),
    age: e.number(),
});

// ✅ Valid - returns the parsed object
schema.parse({ name: 'Alice', age: 30 });

// ❌ Invalid - throws an error
schema.parse({ name: 'Bob', age: '30' });

TODO List:

  • Implement refinements
  • Add e.email(), e.url(), e.uuid(), e.date(), e.boolean(), e.null(), e.undefined()

About

A lite type-safe schema validator inspired by Zod

Resources

Stars

Watchers

Forks

Packages

No packages published