CLI Quiz App Using Node.js — a practical guide to Node.js CLI quiz with clear examples you can reuse in real projects.
CLI Quiz App Using Node.js — 31/55 in the Node.js series. Full playlist companion: Node.js complete course on YouTube. Prefer one article? Read the complete Node.js tutorial.
Short description
CLI apps teach input/output streams. Use `readline` to ask questions and compare answers.
Simple quiz
const readline = require('readline');
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
rl.question('Capital of France? ', (answer) => {
console.log(answer.trim().toLowerCase() === 'paris' ? 'Correct!' : 'Wrong');
rl.close();
});