Tiny Fetch-based HTTP client with ergonomic helpers, retries, and hooks.
Ky is a small, dependency-free HTTP client built on the Fetch API for modern runtimes like browsers and Node.js. It adds method shortcuts, typed response helpers, retry and timeout handling, and hook-based lifecycle extensions. The source exports a factory that creates Ky instances with merged defaults and exposes helper symbols for retry control.
| Languages | TypeScript |
| Frameworks | None |
| Build System | npm |
| Package Manager | N/A |
- Node.js >=18
- npm
- Install dependencies: npm install
- Run tests and lint/build: npm test
- Build distribution output: npm run build
- If running browser-related tests, install Playwright browsers: npx playwright install --with-deps
Key commands: npm install, npm test, npm run build, npx playwright install --with-deps
source- Library TypeScript source and public exports.source/core- Core request engine, retry, hooks, and response helpers.source/errors- Error types thrown by the client.source/utils- Shared helpers for merging options, normalization, and body/timeout handling.source/types- Public TypeScript type definitions for options, hooks, and responses.
- Read this document
- Run the dev server:
npm install - Pick one of these starter tasks:
- Document Node.js version requirement: Add a short prerequisite note in the Install section that Node.js >=18 is required, matching package.json engines.
- Document ky.stop and ky.retry helpers: Add a brief README snippet showing how to stop retries in beforeRetry and how to trigger retries from afterResponse.
- Test prefixUrl leading-slash validation: Add an AVA test that asserts ky throws when prefixUrl is used with an input starting with '/'.
- 📖 ONBOARDING.md - Full setup guide
- 🏗️ ARCHITECTURE.md - System design
- 🗺️ CODEMAP.md - Directory tour
- ✅ FIRST_TASKS.md - Starter issues
Generated by Repo Bootcamp