import * as readline from 'readline' export async function confirm(message: string): Promise { const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }) return new Promise((resolve) => { rl.question(`${message} [y/N] `, (answer) => { rl.close() resolve(answer.toLowerCase() === 'y') }) }) } export async function prompt(message: string): Promise { const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }) return new Promise(resolve => { rl.question(message, (answer) => { rl.close() resolve(answer) }) }) }