Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,369 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pokenode-ts

A typed PokéAPI client with zero runtime dependencies.

npm version CI codecov 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 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

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

About

A lightweight Node.js wrapper for the PokéAPI with built-in types.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

320 stars

Watchers

2 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages