const readline = require('readline') const rl = readline.createInterface({ input: process.stdin, output: process.stdout }) // 今のフェーズを管理する const PHASE = { NORMAL: 0, WILL_QUIT: 1 // quitするか聞いてる時 } let phase = PHASE.NORMAL console.log('Please enter some text:') rl.prompt() rl.on('line', input => { switch (phase) { case PHASE.NORMAL: if (input === 'quit') { console.log('Really?') rl.prompt() phase =
