Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "cli/logIndicator"

Index

Variables

Functions

Variables

Const cache

cache: { spinner?: ora.Ora }

Holds spinner instances

Type declaration

  • Optional spinner?: ora.Ora

ora

ora: { promise: any }

Type declaration

    • (options?: Options | string): Ora
    • Elegant terminal spinner.

      example
      import ora = require('ora');
      
      const spinner = ora('Loading unicorns').start();
      
      setTimeout(() => {
      spinner.color = 'yellow';
      spinner.text = 'Loading rainbows';
      }, 1000);

      Parameters

      • Optional options: Options | string

        If a string is provided, it is treated as a shortcut for options.text.

      Returns Ora

  • promise: function
    • promise(action: PromiseLike<unknown>, options?: Options | string): Ora
    • Starts a spinner for a promise. The spinner is stopped with .succeed() if the promise fulfills or with .fail() if it rejects.

      Parameters

      • action: PromiseLike<unknown>

        The promise to start the spinner for.

      • Optional options: Options | string

        If a string is provided, it is treated as a shortcut for options.text.

      Returns Ora

      The spinner instance.

Functions

Const create

  • create(text: string): void
  • Creates a new spinner instance with the specified message

    Parameters

    • text: string

      Output display message

    Returns void

Const end

  • end(message?: string, isError?: boolean): void
  • Terminates the current spinner with the specified output message

    Parameters

    • Default value message: string = ""

      Output message

    • Default value isError: boolean = false

      Renders output as error toggle

    Returns void

Const fail

  • fail(message: string): void
  • Terminates the current spinner as an error with output message

    Parameters

    • message: string

      Spinner message.

    Returns void

Const update

  • update(text: string): void
  • Updates the text of the current spinner

    Parameters

    • text: string

      CLI output text to display

    Returns void

Generated using TypeDoc