Pokenode-ts

August 16, 2026 · View on GitHub

Pokenode-ts

A typed PokéAPI client with zero runtime dependencies.

npm version CI Quality Gate Status install size

Documentation · Getting started · Migrating to 2.0


npm install pokenode-ts
import { 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');

Features

  • 🛠️ 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 fetch for proxies, retries, headers, or timeouts.
  • 🌲 Pluggable logging — console, pino, a metrics collector, or nothing at all.
  • 🧭 One client or twelve — a focused client, or MainClient sharing one cache across all.

Documentation

Guides and a page per client live at pokenode-ts.vercel.app.

Guide
Getting startedInstallation, first request, choosing a client
ErrorsWhat throws, what doesn't, and how to tell
CacheTuning the default store, or supplying your own
LoggingThe Logger interface
Custom FetchProxies, retries, headers, timeouts
Migrating to 2.0Coming from the Axios-based 1.x

Fair use

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.

Contributing

Bug reports, docs fixes, and pull requests are welcome — see CONTRIBUTING.md. Commits follow Conventional Commits.

License

MIT

Analytics