This project implements a command-line interface (CLI) Pokédex application built with Node.js. The application provides an interactive REPL environment for exploring Pokémon data through the PokéAPI service.
A REPL (Read-Eval-Print-Loop) is an interactive programming environment that processes user input in real-time. Users can enter commands and immediately view results, creating a seamless command-line experience.
The application uses PokéAPI, a comprehensive RESTful API providing structured access to Pokémon data. This free service offers detailed information about Pokémon species, locations, and game mechanics.
- CLI Development: Build robust command-line applications using Node.js
- HTTP Client Implementation: Execute and manage HTTP requests using Node.js native modules
- JSON Processing: Parse and manipulate JSON data structures effectively
- Performance Optimization: Implement caching strategies to enhance application responsiveness
- Node.js - JavaScript runtime environment
- HTTP Module - Native Node.js HTTP client
- JSON - Data interchange format
- PokéAPI - Pokémon data service
- Node Version Manager (NVM) - Recommended for Node.js version management
- Node.js (version 14.0 or higher)
- npm (Node Package Manager)
On macOS/Linux:
# Install NVM using curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
# Or using wget
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
On Windows:
# Install nvm-windows from GitHub releases
# Download and install from: https://github.com/coreybutler/nvm-windows/releases
# Restart your terminal or source your profile
source ~/.bashrc # or ~/.zshrc
# Install the latest LTS version of Node.js
nvm install --lts
# Use the installed Node.js version
nvm use --lts
# Verify installation
node --version
npm --version
-
Clone the repository
git clone https://github.com/ahm4dd/pkdex.git cd pkdex
-
Use the correct Node.js version
# Use the Node version in .nvmrc nvm use
-
Install dependencies
npm install
-
Build the application
npm run build
-
Start the application
npm run start
help
- Display available commands and usage informationexit
- Terminate the CLI application
map
- Retrieve and display the next 20 location areas in the Pokémon worldmapb
- Navigate backward to display the previous 20 location areas
explore [area-name]
- List all Pokémon species found in the specified location areacatch [pokemon-name]
- Attempt to catch the specified Pokémoninspect [pokemon-name]
- Display detailed statistics and information for a caught Pokémonpokedex
- Displays all caught Pokémons
# Start the application
npm run start
# This should start the REPL interface
# View available commands
> help
# Explore location areas
> map
> explore pallet-town-area
# Catch and inspect Pokémon
> catch pikachu
> inspect pikachu
# Displaying the caught Pokémons
> pokedex
- Interactive Command Processing: Real-time command interpretation and execution
- Data Caching: Optimized performance through intelligent data storage
- Error Handling: Comprehensive error management for network and user input issues
- Pagination Support: Efficient navigation through large datasets