A command-line Pokédex built with TypeScript that fetches data from the PokéAPI.
This project is a command-line interface (CLI) tool that allows users to look up information about Pokémon characters. It functions as a digital Pokédex, providing details such as names, types, stats, and other characteristics of Pokémon.
- Fetch Pokémon data from the PokéAPI
- Search for Pokémon by name or ID
- Display detailed information including:
- Basic info (name, ID, height, weight)
- Types
- Base stats
- Abilities
- Command-line REPL interface for interactive use
- Caching mechanism for improved performance
Install NVM (preferred way to manage Node.js versions in this Project).
Use one of the following URLs:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bashwget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bashCheck to make sure you've activated the correct version of node by typing:
node --version
# Prints: v22.15.0If you get error bash: /usr/bin/node: No such file or directory, run this command to load nvm script:
source ~/.bashrcCheck that the nvm command is recognized:
nvm --version
# You should see a version number (like 0.40.3).Now that nvm is working, tell it to install and use the version specified in .nvmrc:
nvm install
# This command reads the `.nvmrc` file and installs the version it finds there.Check that the correct versino is active:
node --versionThis project uses Test-Driven Development (TDD) with the Vitest testing framework. It's very popular and easy to setup:
npm install -D vitestOnce you have at least a few tests in your suite, run the tests using npm run test from the root of the repo.
JSON lint is a useful tool for debugging JSON, it makes it easier to read.
JSON to TS a useful tool for converting JSON to TS interfaces/types. You can use it to generate the structs you'll need to parse the PokeAPI response.