Hoi hoi! π
I'm nyaomaru, a frontend engineer and OSS developer working mostly with TypeScript.
When we need runtime validation in TypeScript, the conversation often turns into this π
"Which library should I use?"
Zod ?
Valibot ?
ArkType ?
typia ?
Or maybe, just write a type guard?
I maintain is-kit , so I think about this boundary quite a lot.
And recently I started wondering
Are we comparing libraries that are actually solving the same problem?
For example, if all I want is this
if ( isUser ( input )) { input . name ; }
Enter fullscreen mode
Exit fullscreen mode
do I really need a schema system?
But if I want:
structured validation errors
transformations
parsing
schema metadata
framework integrations
then a small boolean guard is probably not enough either.
So instead of asking "Which validator is best?" , I tried a different comparison.
I implemented the same User validation with:
a handwritten guard with a TypeScriptβ¦