chalk#inverse TypeScript Examples

The following examples show how to use chalk#inverse. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: vaultHandler.ts    From cli with Apache License 2.0 6 votes vote down vote up
private async ensureValidityOrAbort(entries: VaultEntryAttributes[]) {
    let valid = false;
    while (!valid) {
      const key = await CliUx.ux.prompt('', {
        type: 'single',
        required: false,
        prompt: `\n${inverse('Press any key to continue. Press q to abort')}\n`,
      });
      if (key === 'q') {
        throw new ProcessAbort();
      }
      try {
        this.ensureEntriesValidity(entries);
        valid = true;
      } catch (error) {
        CliUx.ux.log('');
        CliUx.ux.warn(`${error}`);
        await this.openFile(false);
      }
    }
  }