import prompts from 'prompts' // prompts is badly typed so we have some more specific typed APIs // prompts also returns an undefined value on SIGINT which we really just want to exit on export async function confirmPrompt (message: string, initial: boolean = true): Promise { const { value } = await prompts({ name: 'value', type: 'confirm', message, initial, }) if (value === undefined) { process.exit(1) } return value } export async function textPrompt (message: string): Promise { const { value } = await prompts({ name: 'value', type: 'text', message, }) if (value === undefined) { process.exit(1) } return value }