A typed PokéAPI client with zero runtime dependencies.
npm install pokenode-tsimport { PokemonClient } from 'pokenode-ts';
const api = new PokemonClient();
const luxray = await api.getPokemonByName('luxray');
console.log(luxray.name); // "luxray"
console.log(luxray.types.map((slot) => slot.type.name)); // ["electric"]Need more than one section of the API? MainClient bundles all twelve clients behind one object,
sharing a single cache:
import { MainClient } from 'pokenode-ts';
const api = new MainClient();
await api.pokemon.getPokemonByName('luxray');
await api.berry.getBerryByName('cheri');- 🛠️ Typed end to end — every response mirrors the PokéAPI schema, checked at compile time.
- 🪶 Zero dependencies — native
fetch. Node 22+, Deno, Bun, browsers, edge runtimes. - 📦 Caching you control — in-memory by default; swap in Redis, KV, or any
CacheStore. - 🔌 Your transport — pass a custom
fetchfor proxies, retries, headers, or timeouts. - 🌲 Pluggable logging — console, pino, a metrics collector, or nothing at all.
- 🧭 One client or twelve — a focused client, or
MainClientsharing one cache across all.
Guides and a page per client live at pokenode-ts.vercel.app.
| Guide | |
|---|---|
| Getting started | Installation, first request, choosing a client |
| Errors | What throws, what doesn't, and how to tell |
| Cache | Tuning the default store, or supplying your own |
| Logging | The Logger interface |
| Custom Fetch | Proxies, retries, headers, timeouts |
| Migrating to 2.0 | Coming from the Axios-based 1.x |
The PokéAPI is free and community-run. Pokenode-ts caches by default, which covers most of what its
fair use policy asks. For heavy traffic,
run your own instance and point baseURL at it.
Bug reports, docs fixes, and pull requests are welcome — see CONTRIBUTING.md. Commits follow Conventional Commits.
- Liked it? Give it a star ⭐
- Found a problem? Open an issue 🔎
- Find it useful? Buy me a coffee ❤️