diff --git a/src/util/cli.ts b/src/util/cli.ts new file mode 100644 index 0000000..705fce1 --- /dev/null +++ b/src/util/cli.ts @@ -0,0 +1,17 @@ +import * as ora from 'ora' +import * as chalk from 'chalk' + +export function createActionSpinner(action: string) { + return ora({ + prefixText: chalk.bold(chalk.greenBright(action)), + color: 'green', + }) +} + +export function startActionSpinner(action: string) { + return createActionSpinner(action).start() +} + +export function stopActionSpinner(spinner: ora.Ora) { + spinner.stopAndPersist() +}