nuran-quiz-cli
v1.1.0
Published
A fun terminal-based JavaScript quiz game
Maintainers
Readme
CLI Quiz Game
A colorful, interactive JavaScript trivia quiz that runs in your terminal. Answer questions, track your score, and see if you can beat 60% to reach the winner screen.
Demo
Welcome to the CLI Quiz Game! ← animated rainbow title
HOW TO PLAY
I am a process on your computer.
If you get any question wrong I will be killed
So get all the questions right...
What is your name? › PlayerEach answer is validated with a spinner animation. At the end, your score percentage determines whether you see the pastel gradient winner banner or the failure message.
Prerequisites
- Node.js v18+
Installation
Play instantly without installing
npx nuran-quiz-cliInstall globally via npm
npm install -g nuran-quiz-cli
quiz-gameFrom source
git clone <repo-url>
cd node_cli_tool
npm install
node index.jsHow It Works
The game flows through five stages:
- Welcome screen — animated rainbow title + rules
- Name prompt — personalizes all feedback messages
- 5 questions — multiple-choice JavaScript trivia
- Answer check — spinner + pass/fail feedback after each answer
- Results — score ≥ 60% shows a large figlet banner in pastel gradient; below 60% shows a failure message
Questions
All questions test JavaScript fundamentals:
| # | Topic |
|---|-------|
| 1 | JavaScript release date |
| 2 | String + number coercion ("5" + 2) |
| 3 | Loose equality (5 == "5") |
| 4 | Block-scoped variable keywords |
| 5 | Arrow function syntax |
Scoring
Your score is calculated as (correct answers / total questions) × 100.
- ≥ 60% — Winner screen with animated pastel banner
- < 60% — Failure message with your percentage
Dependencies
| Package | Purpose |
|---------|---------|
| chalk | Terminal text colors and backgrounds |
| chalk-animation | Animated rainbow title |
| figlet | Large ASCII-art text for the winner screen |
| gradient-string | Pastel gradient on the winner banner |
| inquirer | Interactive select + input prompts |
| nanospinner | Spinner animation while checking each answer |
Project Structure
node_cli_tool/
├── index.js # Game logic and flow (entry point)
├── questions.js # Quiz questions and correct answers
└── package.json # Package config with "quiz-game" bin aliasLicense
ISC
