Hacker News new | ask | show | jobs
by timpetri 623 days ago
Looking around on Twitter and repos in the OSS community, it appears that Zod is now almost always favored over yup, despite an almost identical API. Curious to hear what people think if they've worked with both. We went with Yup early on at my company, and now that's what we use for consistency in our codebase. I haven't personally found it to be lacking, but some of the logic around nulls and undefined always lead me back to the docs.
2 comments

My company used Yup initially but we moved to Zod to be able to infer types from schemas. For example, API response payloads are Zod schemas. OpenAPI components are also generated from Zod schemas.

There are some performance issues, and WebStorm is struggling, which forced me over to VS Code.

But overall pretty happy.

But Yup also allows to infer types from schemas...
Sorry, might have mixed up Yup and Joi. Anyways, I prefer Zod to both of them.
Some tech influencers pushed Zod - that's basically the entire story