colinhacks/zod
View on GitHub ↗ ★ 44,244 TypeScript
TypeScript-first schema validation with static type inference
50 mentions on Hacker News by 39 people: 5 stories, 45 comments · first 2020-03-10 · latest 2026-10-26
20082026
-
The commit was still not only in git history, but also on the release page on github for 4.6.6: https://github.com/colinhacks/zod/releases/tag/v4.6.6 So I think it's not a great leap to think this commit actually made it to 4.6.6 on npm.…
comment by jaapz · 2026-10-12 · in Zod 4.6.6 compromised by malware? -
The compromised code is still tagged on Github as of 2026-10-12T10:37:51: https://github.com/colinhacks/zod/releases/tag/v4.6.6 . See commit d821685.
comment by Meneth · 2026-10-12 · in Zod 4.6.6 compromised by malware? -
…downloaded the tarball to verify, but it looks like it was reverted prior to the GitHub release: https://github.com/colinhacks/zod/commit/10dda3a3a4bc76ed0bf...
comment by Jarred · 2026-10-12 · in Zod 4.6.6 compromised by malware? -
…interesting commit (d821685) "Fix bugs and improve performance", that contain the following changes https://github.com/colinhacks/zod/commit/d821685ea6732436fcd... I didn't study what packages/mini/meta.test.mjs is doing in particular but…
comment by luggage_bazooka · 2026-10-12 · in Zod 4.6.6 compromised by malware? -
…to serialize or de-serialize schemas, unless you convert to JSON schema, which is verbose. See: https://github.com/colinhacks/zod/discussions/2030
comment by lunarcave · 2025-07-28 · in Show HN: Token-efficient zod-like schema definition library for LLMs -
Pretty easy to add runtime validation at the edges with Zod https://github.com/colinhacks/zod Great thing is that the zod schema also doubles as your typescript type so you don't have to write a duplicate/shadow TS type definition.
comment by terandle · 2024-11-07 · in Forget CDK and AWS's insane costs. Pulumi and DigitalOcean to the rescue -
To this day Zod is still a huge PITA to use. See https://github.com/colinhacks/zod/issues/372
comment by stevebmark · 2024-10-10 · in Zod: TypeScript-first schema validation with static type inference -
…under `exactOptionalPropertyTypes`? Zod doesn't (yet[0]) and it's been a pain point for me. [0] https://github.com/colinhacks/zod/issues/635
comment by kaoD · 2024-10-09 · in Zod: TypeScript-first schema validation with static type inference -
…support in C# can do now. Still, it would be nice to have first class support from a language. https://github.com/colinhacks/zod https://github.com/SteveDunn/Vogen
comment by throwaway13337 · 2024-03-02 · in Ada 95: The Craft of Object-Oriented Programming -
…the functional programming enthusiast corner of the Python community, so you might look there! [1]: https://github.com/colinhacks/zod [2]: https://github.com/ianstormtaylor/superstruct [3]: https://github.com/sinclairzx81/typebox
comment by chriskrycho · 2023-11-03 · in Where DRY Applies -
Zod[1] is probably the closest 1: https://www.npmjs.com/package/zod 1: https://github.com/colinhacks/zod
comment by Loeffelmann · 2023-10-26 · in Show HN: Instant API – Build type-safe web APIs with JavaScript -
https://github.com/colinhacks/zod
comment by anandchowdhary · 2023-08-12 · in tRPC – Build and consume typesafe APIs without schemas or code generation -
…chained syntax. - Zod recently announced they were deprecating discriminated unions (see https://github.com/colinhacks/zod/issues/2106 ) because it was hard to maintain given their architecture. Not only are they supported in `arktype`,…
comment by ssalbdivad · 2023-03-16 · in ArkType: TypeScript's 1:1 validator, optimized from editor to runtime -
…If you actually want to learn, then take a look at the implementation for stuff like Zod: https://github.com/colinhacks/zod/tree/master/src/helpers You can do some really powerful stuff that hugely benefits your team. A decent example I…
comment by Benjamin_Dobell · 2023-01-01 · in Ask HN: What are the best open source TypeScript projects I can learn from? -
…But the branding is a lot easier if you just use something like zod [1] for all your types. [1] https://github.com/colinhacks/zod#brand
comment by shirogane86x · 2022-12-16 · in Lichess gets a big upgrade. It doesn't go as planned -
We use and recommend Zod for that: https://github.com/colinhacks/zod#error-handling
comment by hu3 · 2022-12-14 · in SvelteKit 1.0 -
Seamless runtime checks are fully supported via zod. https://github.com/colinhacks/zod You’re welcome. (I use this library every day. It has changed my life.)
comment by purplerabbit · 2022-10-13 · in Hegel – An advanced static type checker for JavaScript -
…b) Use zod to verify the API data before you use it, to make sure it matches your expectations. https://github.com/colinhacks/zod
comment by bluepnume · 2022-10-07 · in Overzealous Destructuring -
…like Zod[1] or similar to define your type guards and then infer the static types from there. 1: https://github.com/colinhacks/zod
comment by eyelidlessness · 2022-06-13 · in Aleph.js – Fullstack Framework in Deno -
…systems use eval. Surprising, why is that? As far as I can tell, my go-to schema system doesn’t. https://github.com/colinhacks/zod
comment by girvo · 2022-05-14 · in FormKit: Form building framework for Vue 3 -
…of libraries are great in my experience. Here's a comparison of some of the more popular ones: https://github.com/colinhacks/zod#comparison
comment by purplerabbit · 2022-03-03 · in We don't need runtime type checks -
…this again. Ah you hit me where it hurts - really need to seriously try the Erlang ecosystem. [0] https://github.com/colinhacks/zod
comment by LAC-Tech · 2022-02-24 · in Server Side Rendering at scale -
…like zod[1]. It's not the prettiest though; first class support would definitely be better. 1 - https://github.com/colinhacks/zod
comment by danenania · 2022-01-12 · in From TypeScript to ReScript -
…works as a TS typeguard). [1] https://github.com/microsoft/TypeScript/wiki/TypeScript-Desi... [2] https://github.com/colinhacks/zod
comment by kipple · 2021-12-13 · in Deno Joins TC39 -
…GitHub stars for a long time, and it has never been fulfilling. I wouldn’t recommend it. [0] https://github.com/colinhacks/zod
comment by colinmcd · 2021-11-12 · in Tips For Making a Popular Open Source Project in 2021 -
…And if you migrate to typescript you'll get type definitions for free out of those schemas. [1] https://github.com/colinhacks/zod
comment by panzerklein · 2021-09-10 · in JSON Schema bundling formalised -
I tried to introduce `zod` ( https://github.com/colinhacks/zod ) to achieve the same thing within my current team. The idea was that API responses that weren't reflected in the types would cause hard errors that we had to fix, and that…
comment by lhnz · 2021-08-08 · in Testing in production: using JSON Schema for 3rd party API response validation -
…other functions only operate on that validated data. There are (ugly?) workarounds though [1]. [0]: https://github.com/colinhacks/zod [1]: https://gist.github.com/dcolthorp/aa21cf87d847ae9942106435bf...
comment by renke1 · 2021-05-15 · in Parsix: Parse Don't Validate -
…to the docs might be helpful. Here's a great example of what such a comparison might look like: https://github.com/colinhacks/zod#comparison
comment by CGamesPlay · 2021-03-24 · in Show HN: Bangle.dev – Collection of tools for building rich text editors -
…this as a language-feature. There are two more libraries I know which are great for that: * Zod: https://github.com/colinhacks/zod * io-ts: https://github.com/gcanti/io-ts (for the more functional-programming-oriented)
comment by Shacklz · 2021-03-02 · in How an Anti-TypeScript “JavaScript developer” like me became a TypeScript fan -
…been using Zod for the same purpose - they've got a nice comparison section that included io-ts https://github.com/colinhacks/zod#comparison
comment by Lunrtick · 2021-02-03 · in Bad TypeScript Habits -
None of this is unique to Rust - I can do this in typescript: Serde -> Zod ( https://github.com/vriad/zod ) Diesel -> Prisma Yet you expose yourself to concepts that are unique to Rust that do not enhance the developer experience (such as…
comment by g_delgado14 · 2020-10-30 · in Is Rust web yet? -
…agree and would like to point to another library that is capable of providing runtime typechecks: https://github.com/vriad/zod It doesn't come with the fp-approach that io-ts takes, and has, in my opinion, significantly better error…
comment by Shacklz · 2020-06-21 · in Deno will stop using TypeScript -
…Typescript (lots of inference issues), but now it's gotten quite good. You can use something like https://github.com/vriad/zod to get both runtime validation and static types (via inference) at the same time. The downside is defining your…
comment by danenania · 2020-06-07 · in Choose Boring Technology (2015) -
…aeson, but if you’re scared of the baggage it comes with then how about giving zod a try? https://github.com/vriad/zod
comment by Ezku · 2020-04-09 · in How porting to TypeScript solved our API woes -
…to spot a link to Zod's code Colin. Fancy making it a bit more obvious in the post? Edit: Found it: https://github.com/vriad/zod
comment by adriancooney · 2020-03-12 · in Designing the perfect TypeScript schema validation library