Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/lume/deps/cliffy.ts>Number

🔥 Static site generator for Deno 🦕
Very Popular
Latest
class Number
extends GenericSuggestions<number, string, NumberSettings>
import { Number } from "https://deno.land/x/lume@v2.4.1/deps/cliffy.ts";

Number prompt representation.

Methods

protected
addChar(char: string): void

Add char to input.

protected
format(value: number): string

Format output value.

protected
getValue(): string

Get input input.

protected
handleEvent(event: KeyCode): Promise<void>

Handle user input event.

protected
manipulateIndex(decrease?: boolean)

Decrease/increase input number.

protected
success(value: number): string | undefined
protected
transform(value: string): number | undefined

Map input value to output value.

protected
validate(value: string): boolean | string

Validate input value.

Decrease input number.

Increase input number.

Static Methods

inject(value: string): void

Inject prompt value. Can be used for unit tests or pre selections.

prompt(options: string | NumberOptions): Promise<number>

Execute the prompt and show cursor on end.