creator of Zod, Nub, Standard Schema, tRPC, and zshy 💎 building @pullfrogai 🐸 friendly neighborhood typescript nerd 🦆 prev @ bun, edgedb, mit 🏛️

Introducing Nub. The all-in-one JavaScript toolkit that augments Node.js (instead of trying to replace it)
123
153
1,847
349,505
this is gold
31
688
7,074
359,678
sometimes I write code that weaponizes the insanity of JavaScript just to feel alive
61
88
2,182
203,008
love this part of twitter
18
157
4,063
105,990
somehow this is the meanest thing anyone's ever said to me
19
169
3,664
151,818
Zod 4 is now in beta! 💎 7x faster object parsing 💎 20x reduction in tsc instantiations 💎 57% smaller core bundle size 💎 metadata via .meta() 💎 z.toJSONSchema() 💎 z.templateLiteral() 💎 z.stringbool() 💎 z.int32(), z.float32(), etc 💎 z.file() 💎 new logo 😇
133
363
3,713
272,523
Zod 4 is now stable and production-ready! 💎 7x faster object parsing 💎 100x fewer tsc instantiations 💎 localization in 34 languages 💎 recursive z.object()! 💎 metadata 💎 z.toJSONSchema() 💎 z.templateLiteral() 💎 z.int32(), z.float32(), etc 💎 z.file() 💎 and a new logo :)
57
406
3,492
217,835
ummmmm
66
50
3,129
252,323
Introducing Zod 4.1 and its flagship feature: CODECS z.codec() is a new API for defining *bi-directional transformations* in Zod
92
214
3,159
308,079
who suggested this and why weren't they fired immediately
38
61
2,618
163,090
been building a website for the last 3 days. meticulously crafted UI. 100 lighthouse score. sent it to my non-software friend for feedback. her response changed my life
46
43
2,285
86,289
whoa. I just found a way to properly infer recursive types in z.object() — no casting, no z.lazy(), no scopes/registries, no special syntax. i've been trying to do this for literally years
51
114
2,203
157,464
this guy must be stopped
📢Introducing ArkRegex📢 a drop in replacement for new RegExp() with types ⬇️
13
40
1,728
253,853
BIG DAY. Introducing Standard Schema 1.0! It's a specification for a "common interface" to be implemented by all TypeScript schema libraries, written collaboratively by the the creators of Zod (👋), Valibot, and ArkType to promote interoperability. standardschema.dev/
41
245
1,644
147,854
whenever i think i've hit the bottom of the JS rabbithole..
25
47
1,571
159,658
maybe the ultimate JavaScript interview question
67
44
1,416
525,666
Replying to @sptonjohn
thanks I'll check it out
18
46
1,545
20,500
didn't know this was happening.... OpenAI is using Zod for its Structured Outputs API 🫶
by very popular demand, structured outputs in the API: openai.com/index/introducing…
19
43
846
113,225
my secret to writing good docs is "never put two paragraphs in a row"
18
25
1,328
80,927
A simple general purpose memoizer utility for TypeScript - lazily computes a value when accessed - auto-caches the result by overwriting the getter - typesafe I use this all the time for deferring initialization or expensive operations. unlike a simple getter, there's no runtime overhead after the first invokation since the getter itself is overwritten with the memoized value.
33
71
1,308
131,944
loving this pattern to avoid redundancy in complex class declarations...extract the props from the class prototype and use it as the constructor argument ✅ typesafe ✅ no redundant interfaces ✅ constructor becomes a one-liner
39
84
1,256
96,474
Introducing zshy — a bundler-free batteries-included build tool for TypeScript libraries 🐒
26
75
1,172
117,767
zod@4.0.0 is now published to npm 🎉
14
80
1,127
57,970
Zod's CI just failed after thousands of successful runs due to the world's most obvious race condition
17
23
1,077
92,084
Bun has officially rendered its first React Server Component
19
23
1,005
98,675
Zod 4 stable will be released this Monday, May 19th
21
78
1,041
51,410
never occurred to me that you could pass a string template literal into Pick/Omit typescript is so good
16
55
1,019
51,906
crazy that this just works now
44
30
1,018
105,997
no all-loving god would allow this
56
16
971
97,150
if I may be so bold, I'd like to propose some much-needed nomenclature
30
41
940
59,260
or my personal favorite... symlinking everything to README.md
Hear me out: We should standardize rules files as... CONTRIBUTING.md Not CLAUDE.md, .cursorrules, copilot-instructions.md and all that BS
29
36
947
166,823
i love my OrWhatever<T> utility that allows anything but still preserves autocompletion on some wrapped type
23
31
909
58,194
a better "typeof" implementation used by Zod for human-friendly error reporting
10
50
881
71,053
I found a prettier way to Prettify
21
39
861
80,753
Benchmarking Bun / Vitest / Jest against Zod's test suite Bun — 230ms Vitest — 1.9s (8x slower) Jest + SWC — 3s (13x slower) Jest w/ ts-jest — 6.7s (29x slower) Jest w/ Babel — 7.4s (32x slower)

ALT https://gist.github.com/colinhacks/e3095172a883a9ee9c972caf33b5f54f

20
81
800
180,529
zod crossed 40m weekly downloads for the first time
33
20
833
38,009
new `merge` implementation just dropped and it was written by the actual god of typescript
11
24
763
51,740
facebook dot com made react, jest, and graphql and yet is slow, buggy, and littered with waterfalls. really makes you think
32
7
709
49,471
i don't want to brag but I just wrote a GitHub Action that ran successfully the first time
45
7
677
67,371
turns out RSCs are a shockingly pleasant way to make static sites i'm as surprised as anyone
32
12
683
112,516
Big news! I'm joining Clerk (for 3 months) as an OSS Fellow to work full-time on Zod's next major version. Mad props to @clerk for being willing to experiment with new OSS funding models like this 🤠 Thanks @tweetsbycolin! zod.dev/blog/clerk-fellowshi…
35
24
663
69,678
a thread w/ 16 fully-tested Zod codecs to copy/paste into your app ✅ stringTo(Number|Int|BigInt) ✅ numberToBigInt ✅ isoDatetimeToDate ✅ epoch{Seconds|Millis}ToDate ✅ utf8ToBytes ✅ bytesToUtf8 ✅ (hex|base64|base64url)ToBytes ✅ stringToURL ✅ uriComponent ✅ jsonCodec
11
31
664
49,061
yikes
33
6
713
164,976
in the next version of Zod JSON Schema conversion for z.file() schemas gets a lot better (and more OpenAPI friendly)
11
33
649
30,367
bro got 12 PRs merged into TypeScript in the span of 5 hours
19
14
653
116,070
it would shock you how often this has been proposed over the years by recovering Joi users this API makes my skin crawl
30
17
632
98,324
it never occurred to me that you can extract a return type from a generic method like this super clean & powerful, feels almost like higher-kinded types
11
24
643
57,773
how to tell your docs were written in 2021
24
4
636
48,104
i've probably used these shortcuts around 50000 times over the past 4 years ⌘-Shift-L — Insert "console.log()" ⌘-Shift-J — Insert "JSON.stringify()" i will not apologize
12
44
574
can't help but be angry that all it took was for one guy to come in and be like "okay but can we do it tho"
RE: Stacked Diffs on @GitHub After discussion w @ttaylorr_b, we can implement stacked PRs/PR groups already (in fact we kind of do with Copilot) but restacking (automatically fanning out changes from the bottom of the the stack upwards) would be wildly inefficient. To do it right, we need to migrate @GitHub to use git reftables instead of packed-refs so that multi-ref updates / restacking will be O(n) instead of ngmi. This will take some time but has been greenlit.
14
8
602
90,094
let's see if it can one-shot this
13
7
566
29,058
mkay
17
18
509
73,817
swift 6 clowning on typescript
9
6
482
71,464
forty thousand! 🫶
29
6
498
24,658
yeah...this feels good
16
10
496
34,763
✨ Zod 3.21 Release ✨ 🦆 `z.string().emoji()` 🦆 `z.string().ip()` 🦆 `z.string().cuid2()` 🦆 `z.bigint().gt()`, etc. 🦆 `z.enum(...).extract()` and `z.enum(...).exclude()` github.com/colinhacks/zod/re…
6
48
470
62,477
in the absence of an existing convention, I'm adding these three fields to Zod's package.json. making this stuff auto-discoverable would resolve one of the biggest usability issues with today's agents/IDEs. a simple convention here will go a long way. 🤘
23
24
483
40,128
holy moly Zod has twenty thousand GitHub stars ❤️
20
8
462
81,071
an underutilized pattern to add custom functionality to Zod: create a "myzod.ts" file that re-exports everything fro zod. then define additional types/functionality in that file.
Any zod-experts that knows how I can achieve this: 'id: z .id()' And inside there is a 'z .string()' '.instanceof(Id) '.default(db .id())' '.map("_id")' And when the schema is parsed, the default db .id is called.
14
23
439
63,147
i'll have that job now
15
7
441
30,766
new nightmare just dropped an ESM/CJS resolution bug that only manifests on windows
16
11
444
103,821
it took ~10 weeks of work but Zod currently has zero open PRs (this is not a challenge)
19
2
426
26,639
Zod is going global y'all
11
5
425
23,269
here's a particularly ludicrous bit of code demonstrating the power of Standard Schema a Hono route that uses three separate libraries to validate headers, URL params, and query params 😇
7
15
422
23,680
Zod 4 support megathread! all major ecosystem libraries that support Zod 4 if I'm missing anything, link it in the replies 👇
10
21
418
35,824
API proposal 👉 z.envbool()
33
7
410
61,515
Big (belated) update: I'm no longer at Bun! It was a wild ride, and quite possibly the most exciting DevRel role in existence. Big thanks to @jarredsumner for taking a chance on me, and best of luck to the team — you're all amazing 🫶 I've been enjoying a much-needed break after years of non-stop DevRel at EdgeDB & Bun. For the next few months I'll be busy working full-time on Zod and maybe some new OSS projects 🙃 Zod 3.23 coming later this week
14
4
394
47,988
trying to convince a potential landlord i'm a respected open-source developer and not an unemployed beggar living on handouts
19
8
396
20,409
TIL you can use the URL constructor to validate & normalize IPv6 addresses strongly considering this approach for Zod
6
9
382
27,263
just discovered that Zod had $8k of claimable donations sitting in a crypto-based OSS donation platform i'd never heard of called Drips turns out Drips donated $1m of its (VC?) money to its own dependencies...and i will happily take it 🙃 drips.network
14
8
373
47,964
drizzle 🤝 zod 4
3
14
362
16,115
I was playing it coy yesterday :) the release of Zod 4 will be accompanied by a new sister library to Zod: "@zod/mini" its API mirrors Zod one-to-one, but it's optimized for tree shaking—more functions, less methods. for comparison:
zod/mini was also announced yesterday - 6.6x reduction in bundle size. Absolute game changer for frontend Zod use cases
10
19
363
33,793
Spent the last 10 weeks writing Bun's documentation and it just went live! bun.sh/docs The site is built from scratch with Bun + Tailwind + Markdoc (which rules!) and fully designed by yours truly 🤗 Most proud of the star wars meme tho bun.sh/blog/bun-has-docs-now…
14
36
352
56,573
every so often I'm reminded that the whole typescript ecosystem is just gibberish I've memorized
10
12
344
21,230
i'm feeling sendy today
8
12
325
22,846
In Zod 4 z.number().int() will only allow numbers in the safe integer range
9
9
340
18,934
Importing individual fields from .json and .toml files (Bun v1.0.1)
12
17
323
36,905
add this to keybindings.json to give TS/Intellisense suggestions precedence over Cursor autocomplete
11
12
345
22,063
TypeScript's type system is, like, hella structural
9
4
321
67,950
Really digging `azs` from @alistaiir — "Amplify Zod Schemas" 😍 Augment the return type of your Zod schemas with methods: github.com/alii/azs#readme
10
17
322
62,619
considering a new API to defuse some confusion around z.coerce.boolean()
14
2
324
29,120
new blog post 👇 it breaks down a few approaches to configuring "live types" in TypeScript monorepos. you should never need to run `build` while developing! 1. tsconfig paths 2. custom export conditions 3. publishConfig (*my recommended solution) colinhacks.com/essays/live-t…
22
41
348
62,997
the um is me wondering whether to report this to HR
1
311
18,252
petition to switch the JS ecosystem to snake_case naming when
readable code is simple - you have primary functions that compose together a bunch of smaller functions when i wrote elixir this was natural to do i've realized after years in ts my habits eroded for the following reasons 1. extracting out logic into a function is more overhead because you have to write out argument types. sometimes these are complex inferred types you wouldn't have to articulate when logic is inline 2. lack of pipe operator - having a lot of small functions is less fun when you need to name intermediary variables to name every step 3. camel case - i hate camel case and small functions usually can't be one word. `checkUsage` vs `check_usage` trying to be more aware of this because it's biasing me towards fat unreadable functions
24
6
317
95,181
TIL the official MCP TypeScript SDK still doesn't support Zod 4. it's the most upvoted issue by a wide margin, and multiple high-quality PRs have already been submitted addressing this. if you work on the MCP SDK at @AnthropicAI DM me and let's get this figured out 🤙
17
9
357
82,955
trying to find a regex that reflects the latest ISO 8601-2:2019(en) extensions to interval formats stack overflow:
7
7
312
21,340
Nuxt now works with Bun! Upgrade to Bun v0.8 and follow our Bun + @nuxt_js guide to try it ✅ bun.sh/guides/ecosystem/nuxt
11
42
288
43,761
To be fair it was a great PR
3
12
287
83,535
my goal is to one day make something as popular as is-plain-object 'tis but a dream
13
6
299
22,807
in the last 6 weeks Zod has gone from 103 open PRs to 3 many of those were merged into a branch called `v4` 👀
11
9
285
23,875
Zod 3.22.0 has been released It introduces `.readonly()` which calls Object.freeze() on the result after parsing. Here are some examples with their inferred types:
10
17
282
31,500
first commit to tRPC was five years ago today
9
7
281
14,019
the holy grail of TS library build tools doesn't exist imo 1) declarative tshy-style entrypoint map—see pic 2) 1:1 transpilation (no bundling) of all files reachable from entrypoints 3) generates .mjs/.cjs for unambiguous resolution 4) writes "exports" to package.json
17
15
279
43,221
Replying to @sptonjohn
hahaha zero worries my friend! thanks for putting in a good word for Zod 😛
1
261
11,238
and it's not particularly close
18
3
277
20,319
aaaaannnd it's getting merged in typescript@5.9! 🥳
this one-liner PR to typescript would make recursive inference far more elegant in Zod. super valuable for schema libraries, ORMs, anything that represents recursive types. the TS team has a LOT going on right now but fingers crossed🤞 @AndaristRake github.com/microsoft/TypeScr…
4
4
281
16,721