"I'm a Teapot" is a CLI-based quiz game built with Node.js that tests your knowledge across programming-related subjects that we study during our program, including HTTP status codes, PHP, Laravel, Node.js, C#, SQLite, HTML/CSS, and JavaScript. The name is a reference to HTTP status code 418 "I'm a teapot", as our initial thought was to create a quiz app only on status codes. The project was developed collaboratively using pair programming and was also published to npm, making it installable worldwide with a simple npx im-a-teapot command.
Feb 2026
2 weeks
CLI Framework:
We chose Inquirer.js for interactive menus and user prompts. This package allowed us to create smooth navigation with arrow keys and provided a professional feel without needing to build our own input handling from scratch.
Visual Enhancements:
We used Figlet for ASCII art titles and Chalk for colorful terminal output. These packages made the game feel polished and engaging—an important consideration since the terminal can otherwise feel bland.
File Structure:
We organized the code into logical folders (game, questions, utils, data) to separate concerns. The main entry point (index.js) only handles the game loop, while game logic, highscore handling, and UI utilities each have their own modules.
Data Management:
Questions are stored in JSON files, making it easy to add new topics or modify existing questions without touching the code. The highscore is persisted in a separate JSON file with error handling for read/write operations.
Npm Publishing:
We configured package.json with a bin entry to make the game runnable as a global CLI tool. This was a learning experience in understanding how npm packages work and how to share projects with others.
Randomization Logic:
Implementing fair question shuffling required understanding array methods like .sort(() => Math.random() - 0.5). We had to ensure players got a different experience each time while still limiting rounds to 5 questions.
Highscore System:
Managing persistent data with file system operations (fs.readFileSync, fs.writeFileSync) and handling edge cases—like when the highscore file doesn't exist yet—was trickier than expected. We implemented try-catch blocks and existence checks to prevent crashes.
Pair Programming & Collaboration:
Working in a pair using GitHub Flow (branching, pull requests, and issues) was both rewarding and challenging. We learned the value of dividing work into modules, and switching between "driver" and "navigator" roles during pair programming sessions.
Scope Creep with Packages:
We initially installed several packages we didn't fully utilize (like fireworks-js, chalk-animation). This taught us to be more deliberate about dependencies—every package should serve a clear purpose.