@neofork/devlogr - v0.0.3
    Preparing search index...

    Class SpinnerUtils

    Low-level spinner management utilities using listr2.

    Provides direct control over spinners for advanced use cases. Most users should use the Logger class spinner methods instead.

    import { SpinnerUtils } from '@neofork/devlogr';

    SpinnerUtils.start('deploy', { text: 'Deploying...' });
    // ... do work ...
    SpinnerUtils.succeed('deploy', 'Deployed successfully!');
    SpinnerUtils.start('build', { text: 'Building...' });
    SpinnerUtils.start('test', { text: 'Testing...' });

    SpinnerUtils.succeed('build', 'Build complete');
    SpinnerUtils.fail('test', 'Tests failed');
    Index

    Constructors

    Methods

    • Start a named multi-spinner task with the specified options. Used for complex task orchestration with Listr2.

      Parameters

      • key: string

        Unique identifier for this spinner

      • options: SpinnerOptions = {}

        Spinner configuration options

      Returns Listr

      Listr instance for the spinner

    • Stop a named multi-spinner without completion message.

      Parameters

      • key: string

        Unique identifier of the spinner to stop

      Returns void

    • Update the display text of an active spinner.

      Parameters

      • key: string

        Unique identifier of the spinner

      • text: string

        New text to display

      Returns void

    • Complete a multi-spinner with success status.

      Parameters

      • key: string

        Unique identifier of the spinner

      • Optionaltext: string

        Optional success message

      Returns undefined | string

      The completion text or undefined

    • Complete a multi-spinner with failure status.

      Parameters

      • key: string

        Unique identifier of the spinner

      • Optionaltext: string

        Optional failure message

      Returns undefined | string

      The completion text or undefined

    • Complete multi-spinner task with info (alias for succeed)

      Parameters

      • key: string
      • Optionaltext: string

      Returns undefined | string

    • Get a named task runner by key

      Parameters

      • key: string

      Returns undefined | { text?: string; listr?: Listr<any, "default", "simple"> }

    • Stop all active multi-spinner tasks

      Returns void

    • Get all active task keys

      Returns string[]

    • Get currently active spinner (rotates automatically)

      Returns null | string

    • Check if spinners are supported in the current environment.

      Returns boolean

      True if spinners can be displayed, false otherwise

    • Get task statistics for debugging/testing

      Returns {
          totalSpinners: number;
          activeSpinner: null | string;
          hasRotationCycle: boolean;
          isSpinnerPaused: boolean;
      }

    • Pause/Resume methods (listr2 handles this automatically)

      Returns void