3 ms·
I'd recommend TypeBox[1] as an alternative, which has a runtime “compiler” for generating optimized JS functions from the type objects. It also produces a JSON
by aleclarsoniv 2y ago
I'd recommend TypeBox[1] as an alternative, which has a runtime “compiler” for generating optimized JS functions from the type objects. It also produces a JSON schema, which can be useful for generating API docs and API clients if needed.
It also has a companion library[2] for generating TypeBox validators from TypeScript definitions, which I'm currently using in an RPC library I'm working on.
[1]: https://github.com/sinclairzx81/typebox https://github.com/sinclairzx81/typebox
[2]: https://github.com/sinclairzx81/typebox-codegen https://github.com/sinclairzx81/typebox-codegen
- JasonSage 2y agoWe are moving from Zod to TypeBox because there’s a lot of inflexibility in Zod’s extensibility story that we’re able to get past in TypeBox. After doing a deep-dive comparison, I’m left wondering why to ever choose Zod over TypeBox.
- wruza 2y ago[2] Man why doesn’t it have a cli tool?? Wouldn’t it be nice to :'<'>!typeboxify a selection.
- maxthegeek1 2y agoLikewise we use typebox for everything in our project (open source customer.io alternative). https://github.com/dittofeed/dittofeed/blob/main/packages/isomorphic-lib/src/types.ts https://github.com/dittofeed/dittofeed/blob/main/packages/is...