tui-tools 0.1.2

A collection of tools for building terminal user interfaces.
Documentation
  • Coverage
  • 9.43%
    5 out of 53 items documented3 out of 51 items with examples
  • Size
  • Source code size: 7.19 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 343.89 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • 0bject-0bject

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