We're going to make a little terminal command-line interface (CLI) game using the Pokéapi (https://pokeapi.co). Since we have the basic logic of the game at https://github.com/PacktPublishing/Hands-on-JavaScript-for-Python-Developers/tree/master/chapter-7/pokeapi/solution-code, we're just going to get the beginnings going and then you can finish the game as a challenge by porting over the logic from the frontend to the backend with Node.js.
Start with a fresh directory and begin a new project, as follows:
- mkdir pokecli
- npm init
- npm install asciify-image axios terminal-kit
- Copy the Pokéapi logo from https://pokeapi.co to a new img directory with Save Image in the browser.
- Make a new index.js file.
- Modify package.json with a start script, as we've done previously: "start": "node index.js".
Your file structure should look like this, minus the node_modules directory:
.
├── img
│ └─...