Skip to content

A command-line Pokédex built with TypeScript. Fetches data from the PokéAPI to display Pokémon stats, types, and details. Features a REPL interface and caching for performance.

License

Notifications You must be signed in to change notification settings

rewavestudios/pokedex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pokedex

About

A command-line Pokédex built with TypeScript that fetches data from the PokéAPI.

Overview

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.

Features

  • 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

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 | bash
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash

Check to make sure you've activated the correct version of node by typing:

node --version
# Prints: v22.15.0

If you get error bash: /usr/bin/node: No such file or directory, run this command to load nvm script:

source ~/.bashrc

Check 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 --version

🧪 Testing

This project uses Test-Driven Development (TDD) with the Vitest testing framework. It's very popular and easy to setup:

npm install -D vitest

Once you have at least a few tests in your suite, run the tests using npm run test from the root of the repo.

References

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.

About

A command-line Pokédex built with TypeScript. Fetches data from the PokéAPI to display Pokémon stats, types, and details. Features a REPL interface and caching for performance.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published