Skip to content

SpinnerHandle ​

Handle returned by Out.spinner for lifecycle control.

Terminal methods (succeed, fail, stop) are idempotent — calling any of them after the handle is already stopped is a no-op, not an error.

Signatures ​

ts
interface SpinnerHandle {}

Members ​

Methods ​

update ​

Update the spinner text (no-op if stopped).

ts
update(text: string): void;

succeed ​

Stop with a success symbol and optional final text.

ts
succeed(text?: string): void;

fail ​

Stop with a failure symbol and optional final text.

ts
fail(text?: string): void;

stop ​

Stop the spinner without a status symbol.

ts
stop(): void;

wrap ​

Wrap a promise: auto-succeed on resolve, auto-fail on reject.

ts
wrap<T>(promise: Promise<T>, options?: { succeed?: string | { (value: T): string; }; fail?: string | { (error: unknown): string; }; }): Promise<T>;

See Also ​

Released under the MIT License.