ky
zod
| ky | zod | |
|---|---|---|
| 31 | 440 | |
| 16,906 | 42,870 | |
| 0.7% | 0.9% | |
| 8.6 | 9.6 | |
| about 1 month ago | 2 days ago | |
| TypeScript | TypeScript | |
| MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
ky
-
Our response to the Axios developer tool compromise
I usually reach for ky these days since it's an extremely lightweight wrapper over `fetch` - basically just adds a few niceties
https://github.com/sindresorhus/ky
From the readme:
- Simpler API
- Method shortcuts (ky.post())
- Treats non-2xx status codes as errors (after redirects)
- Retries failed requests
- JSON option
- Timeout support
- Upload and download progress
- Base URL option
- Instances with custom defaults
- Hooks
- Response validation with Standard Schema (Zod, Valibot, etc.)
- TypeScript niceties (e.g., .json() supports generics and defaults to unknown, not any)
Of course, this is only for projects where I have to make a lot of HTTP requests to a lot of different places where these niceties make sense. In most cases, we're usually using a library generated from an OpenAPI specification and fall back to `fetch` only as an escape hatch.
-
ky + p-limit: Concurrency Control With Built-in Retry for Batch Requests
Batch 100 API calls with Promise.all and the server returns 429. Add retry and transient network errors self-heal — but there's still no cap on how many run at once. ky handles per-request reliability. p-limit controls overall throughput. Both together is the complete solution.
-
ky: Stop Writing Fetch Boilerplate
Every project using fetch ends up with the same boilerplate: if (!response.ok) throw new Error(...). Add retry and you're writing a loop. Add timeout and you're pulling out AbortController. ky wraps all of that. 4KB, zero dependencies.
-
Decorating Promises Without Breaking Them
This came up while building convenience plugins for ffetch, a lightweight fetch wrapper focused on keeping native semantics intact. Libraries like ky solve the ergonomics problem by introducing a custom Response-like object, which works great until something outside the library expects a plain Response. I wanted a different path.
-
Prerelease of Ky 2.0
https://github.com/sindresorhus/ky?tab=readme-ov-file#how-is...
-
Axios VS Ky: When to use which?
Resources I used for writing this article: Ky: https://www.npmjs.com/package/@smeijer/ky?activeTab=readme https://github.com/sindresorhus/ky Axios: https://www.npmjs.com/package/axios?activeTab=readme https://axios-http.com/docs/intro
-
SvelteKit RPC with Hono
API-routes provide regular endpoints through folder hierarchy, giving you full control over request-response objects and middleware. You can use any HTTP client library—mine is ky.
- Fundamentals of React Native App Development: Dependencies, Performance, Native Modules, and Publishing Guide
- Ky: Tiny and elegant JavaScript HTTP client based on the browser Fetch API
- Ky is a tiny and elegant HTTP client based on the browser Fetch API
zod
-
Building an MCP server with Node.js
This post shows how to build a small todo MCP server with Node.js using the official @modelcontextprotocol/sdk package and Zod schemas.
-
How to Build Type-Safe Form Handlers Using TypeScript Utility Types
This pattern works cleanly with Zod and React Hook Form. Zod schemas can infer TypeScript types directly, so you define validation rules and get the type for free:
-
How to convert a JSON sample to a Zod schema (and the 4 algorithm choices behind a working converter)
Zod closes that gap by validating shape at runtime. The friction is hand-writing the schema. So I built a small in-browser tool that does it for you — paste a JSON sample, get a runnable z.object. This post is about the four non-obvious algorithm choices that came out of that build.
-
Why Multi-Step Forms Outperform Long Single-Page Forms for Complex Signups
Libraries like React Hook Form, Formik, and Zod for schema validation make the per-step validation architecture manageable and well-tested. React and other component-based frameworks make the state sharing pattern clean with context or a global store.
-
Three Ways to Convert JSON to TypeScript. Only One Is Deterministic.
5. Add runtime validation. Use Zod or Valibot to validate that the API actually sends what your types describe. The converter gives you structure; a schema library gives you runtime guarantees.
-
is-kit vs Zod: A Practical Comparison from 3 Perspectives
When writing runtime validation in TypeScript, Zod is usually the first choice.
-
Zod: TypeScript Schema Validation Without the Boilerplate
Do you validate the data your backend API returns? Most people just use as to cast the type and hope the data matches expectations. Zod lets you define a schema once and get both runtime validation and TypeScript types — no more trust-based programming.
-
Modern Next.js Essentials: Building Scalable Full-Stack Applications
Zod is a TypeScript-first schema declaration and validation library. It is widely used in Next.js projects to bridge the gap between runtime data validation and compile-time type safety.
-
zod-to-schema: A Zero-Config CLI That Runs Your TypeScript In-Process
Every serious TypeScript project uses Zod for runtime validation. The team loves it — one schema, end-to-end type inference, parse-don't-validate all the way down. Done, sorted, move on.
-
Stop Writing Types Twice: A Fullstack TypeScript Playbook
This post walks through a pipeline where you define your data shape once as a Zod schema on the backend, and every other layer (API docs, frontend types, React Query hooks) is generated from it automatically using Orval. Change the schema, regenerate, and TypeScript tells you exactly what broke. Across the entire stack.
What are some alternatives?
axios - Promise based HTTP client for the browser and node.js
openapi-typescript - Generate TypeScript types from OpenAPI 3 specs
wretch - A tiny wrapper built around fetch with an intuitive syntax. :candy:
class-validator - Decorator-based property validation for classes.
fetch - A small Fetch API wrapper
typebox - JSON Schema Type Builder with Static Type Resolution for TypeScript