How to use @inquirer/confirm - 1 common examples

To help you get started, we’ve selected a few @inquirer/confirm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RiseVision / rise-node / packages / cli / src / node / reset.ts View on Github external
export async function nodeReset({ verbose, v1 }: TOptions) {
  try {
    if (!v1) {
      throw new ConditionsNotMetError(
        'Currently `node reset` works only with the --v1 param'
      );
    }
    assertV1Dir();
    const reset = await confirm({
      message: 'This will remove all the data. Are you sure?',
    });
    if (reset) {
      await execCmd(
        'rm',
        ['-Rf', 'data/pg'],
        "Couldn't remove the v1 data dir",
        null,
        verbose
      );
    }
  } catch (err) {
    handleCLIError(err);
  }
}

@inquirer/confirm

Inquirer confirm prompt

MIT
Latest version published 10 days ago

Package Health Score

97 / 100
Full package analysis

Popular @inquirer/confirm functions