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.
To install, simply run the following command:
npm install emetify
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' });
- Implement refinements
- Add
e.email()
,e.url()
,e.uuid()
,e.date()
,e.boolean()
,e.null()
,e.undefined()