@chromakit/core
    Preparing search index...

    Function startSpinner

    • A simple terminal spinner with utility methods to update and stop.

      Parameters

      • label: string = 'Loading...'

        Initial text label shown after the spinner.

      • options: SpinnerOptions = {}

        Customization options for behavior and style.

      Returns {
          pause(): void;
          resume(): void;
          stop(finalText?: string): void;
          stopAndPersist(text?: string, symbol?: string): void;
          update(newLabel: string): void;
      }

      An object with methods to control the spinner.

      • Cycle through frames in FRAMES at a consistent interval.
      • Uses readline.clearLine() and readline.cursorTo() to overwrite the current line for smooth in-place updates. These only have effect when stdout is a TTY. (StackOverflow)
      • Methods:
        • .stop(finalText?): Ends spinner and optionally prints a final line.
        • .update(newLabel): Changes displayed label mid-spin.
        • .pause(): Stops the animation but leaves the current frame on screen, then moves to a new line.
        • .resume(): Restarts the spinner after a pause.
        • .stopAndPersist(text, symbol?): Stops and replaces the spinner with a custom symbol and label.
      const spinner = startSpinner('Loading', {
      interval: 60,
      color: (s) => `\x1b[36m${s}\x1b[0m`, // cyan
      });

      // Later…
      spinner.stopAndPersist('Done', '✔');