Pokedex
An interactive REPL for exploring Pokémon data — fetched from the PokéAPI, cached locally, and persisted between sessions.
Features
- Interactive command-line REPL with a modular command registry
- In-memory caching layer (
pokecache) to avoid redundant API calls - Persistent state saved to disk between sessions (
save.json) - Commands: explore locations, catch Pokémon, inspect your party
- Unit tests with Vitest
How It Works
Each REPL command maps to a handler that can access shared state, make API requests, and mutate the pokecache. The cache stores API responses keyed by URL with a configurable TTL — subsequent calls for the same resource are served instantly without hitting the network.
State (your caught Pokémon, explored areas) is serialized to save.json on exit and reloaded on startup, giving the REPL persistence across sessions.
Tech Stack
- Language: TypeScript (Node.js)
- API: PokéAPI (REST)
- Caching: Custom in-memory cache with TTL
- Persistence: JSON file (
save.json) - Testing: Vitest