myzod (v1.12.1) is a TypeScript-first schema validation library with type inference, inspired by Zod. It provides a familiar API for defining schemas using object, string, number, boolean, array, record, union, intersection, and more. Key differentiators include significantly faster parsing performance (claimed ~25x faster than Zod in benchmarks) and a focus on type safety with strict validation. The library emits TypeScript type declarations and supports ESM and CJS. It is actively maintained on GitHub with periodic releases, though less frequent than more popular alternatives like Zod. Its type system closely mirrors TypeScript's own, allowing complex generics like Pick, Omit, and Partial.
npm install myzodNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Defines a User schema with string patterns, number constraints, optional fields, and nullable arrays, then parses an input object with type inference.
Review inferred types when upgrading from v0.x. Use `Infer<typeof schema>` to get new types.
Remove duplicate keys from object schema definitions.
Chain both `.optional()` and `.nullable()` when needed.
Use regex without global or sticky flags.
Wrap lazy schema in a function: `myzod.lazy(() => mySchema)`
Use default import: `import myzod from 'myzod'`
Ensure value matches schema type, or make field optional/nullable.
Define the schema as a type or use `satisfies` keyword if available.
Adjust the input string to match the pattern or modify the schema pattern.
No dependency data recorded yet.