Skip to main content
Module

x/kia/mod.ts>default

🦕 Simple terminal spinners for Deno
Latest
class default
import { default } from "https://deno.land/x/kia@0.4.1b/mod.ts";

Constructors

new
default(options?: InputOptions | string)

Properties

private
currentFrame: number
private
options: Options
private
spinning: boolean
private
textEncoder: TextEncoder
private
timeoutRef: any

Methods

private
render()

Renders each frame of the spinner

fail(text?: string)

Stops the spinner and leaves a failure message.

The function is a wrapper around stopWithFlair.

getFrame(): string

Returns the current spinner frame

getText(): string

Gets the current text

info(text?: string)

Stops the spinner and leaves an information message.

The function is a wrapper around stopWithFlair.

isSpinning(): boolean

Returns whether the instance is currently spinning

Renders the next frame of the spinner when it is stopped.

set(options: InputOptions | string)
start(text?: string)

Starts the spinner

Stops the spinner and clears its line

stopAndPersist(options?: InputOptions)

Stops the spinner and holds it in a static state. Returns the instance.

stopWithFlair(text?: string, flair: string)

Stops the spinner and leaves a message in its place

succeed(text?: string)

Stops the spinner and leaves a success message.

The function is a wrapper around stopWithFlair.

warn(text?: string)

Stops the spinner and leaves a warning message.

The function is a wrapper around stopWithFlair.