Hacker GitHub

← All repos

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

Mentions per year 50 mentions · busiest year 2025 (11)
20082026
  1. ▲ 1
    Zod maintainer refuses v3 CVE backport because advisory is agent-written
    story by hek2sch · 2026-10-26 · 1 comment
  2. 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?
  3. 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?
  4. …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?
  5. …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?
  6. ▲ 183
    Zod 4.6.6 compromised by malware?
    story by luggage_bazooka · 2026-10-12 · 52 comments
  7. ▲ 1
    Show HN: FormData validation for TypeScript (Zod's most requested feature)
    story by sachin97317 · 2025-10-27 · 0 comments
  8. …to serialize or de-serialize schemas, unless you convert to JSON schema, which is verbose. See: https://github.com/colinhacks/zod/discussions/2030
  9. …Zod 4 simultaneously. There's no reliable way to do that if they aren't in the same package.[0] [0] https://github.com/colinhacks/zod/issues/4371
    comment by colinmcd · 2025-05-20 · in Zod 4
  10. …approach is necessary to unlock continuity for Zod's ecosystem libraries. They're quite subtle. [0] https://github.com/colinhacks/zod/issues/4371
    comment by colinmcd · 2025-05-20 · in Zod 4
  11. …for Zod 4 in the ecosystem, I'll publish `zod@4.0.0` to npm. This is detailed in the writeup[0] [0] https://github.com/colinhacks/zod/issues/4371
    comment by colinmcd · 2025-05-20 · in Zod 4
  12. …is so good I still choose to just deal with it :) Thanks for an amazing part of the ecosystem. [0] https://github.com/colinhacks/zod/issues/635
    comment by kaoD · 2025-05-19 · in Zod 4
  13. …ultimately fall short. Ultimately npm wasn't designed for this particular set of circumstances. [0] https://github.com/colinhacks/zod/issues/4371
    comment by colinmcd · 2025-05-19 · in Zod 4
  14. …for Zod or just something you haven't gotten around to implement? (Here are discussions around it: https://github.com/colinhacks/zod/discussions/2134 )
    comment by elbajo · 2025-05-19 · in Zod 4
  15. …and "zod/v4". It provides a nice opt-in incremental upgrade path for end-users of Zod too. [0] https://github.com/colinhacks/zod/issues/4371
    comment by colinmcd · 2025-05-19 · in Zod 4
  16. …and "zod/v4". It provides a nice opt-in incremental upgrade path for end-users of Zod too. [0] https://github.com/colinhacks/zod/issues/4371
    comment by colinmcd · 2025-05-19 · in Zod 4
  17. …it as a major version without the legacy layer EDIT: I've just seen the reason described here: https://github.com/colinhacks/zod/issues/4371 TLDR: He doesn't want to trigger a "version bump avalanche" across the ecosystem. (Which I…
    comment by derN3rd · 2025-05-19 · in Zod 4
  18. 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.
  19. To this day Zod is still a huge PITA to use. See https://github.com/colinhacks/zod/issues/372
  20. …under `exactOptionalPropertyTypes`? Zod doesn't (yet[0]) and it's been a pain point for me. [0] https://github.com/colinhacks/zod/issues/635
  21. …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
  22. …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
  23. Zod[1] is probably the closest 1: https://www.npmjs.com/package/zod 1: https://github.com/colinhacks/zod
  24. https://github.com/colinhacks/zod
  25. …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`,…
  26. …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…
  27. …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
  28. We use and recommend Zod for that: https://github.com/colinhacks/zod#error-handling
    comment by hu3 · 2022-12-14 · in SvelteKit 1.0
  29. 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.)
  30. …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
  31. …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
  32. …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
  33. …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
  34. …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
  35. …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
  36. …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
  37. …GitHub stars for a long time, and it has never been fulfilling. I wouldn’t recommend it. [0] https://github.com/colinhacks/zod
  38. …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
  39. 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…
  40. …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
  41. …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
  42. …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)
  43. …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
  44. 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?
  45. ▲ 1
    Zod: TypeScript-first schema validation with static type inference
    story by searchableguy · 2020-08-20 · 0 comments
  46. …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
  47. …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)
  48. …aeson, but if you’re scared of the baggage it comes with then how about giving zod a try? https://github.com/vriad/zod
  49. …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
  50. ▲ 5
    Show HN: Zod – TypeScript-first validation library with static type inference
    story by vriad · 2020-03-10 · 3 comments