tui-tools

Crates.iotui-tools
lib.rstui-tools
version0.1.2
sourcesrc
created_at2023-08-08 04:37:54.705863
updated_at2023-08-12 23:46:52.888192
descriptionA collection of tools for building terminal user interfaces.
homepage
repositoryhttps://github.com/0bject-0bject/tui-tools
max_upload_size
id938781
size7,199
[object Object] (0bject-0bject)

documentation

README

tui-tools

Description

Some tools I use for colorizing, and accepting input in a tui applications with minimal dependencies.

Usage

Add the following to your Cargo.toml

[dependencies]
tui-tools = "0.1.0"

Examples

Colorize a string, enables ansi on windows.

use tui_tools::Colors;

fn main() {
    println!("{}", "Hello World!".green());
}

Get input from the user.

use tui_tools::getch;

fn main() {
    let input = getch();
    println!("You pressed: {}", input as char);
}

Clear the screen.

use tui_tools::cls;

fn main() {
    cls();
}

License

MIT

Sources

Commit count: 9

cargo fmt