UNPKG

@vortex.so/cli

Version:

CLI to interact with Vortex.

28 lines (25 loc) 524 B
import process from 'node:process'; import prompts from 'prompts'; class Prompt { static async confirm(input) { const answers = await prompts( [ { type: "confirm", name: "isConfirmed", message: input.message, initial: false } ], { onCancel: () => { input.log.abort("Cancelled."); process.exit(0); } } ); if (!answers.isConfirmed) throw new Error(`Cancelled.`); } } export { Prompt };