#input #text #string #entrada #texto

text-input

A simple library for interactive text input in the terminal

3 releases

0.1.2 Nov 12, 2024
0.1.1 Nov 12, 2024
0.1.0 Nov 12, 2024

#451 in Command-line interface

Download history 292/week @ 2024-11-08 48/week @ 2024-11-15 9/week @ 2024-11-22 23/week @ 2024-11-29 10/week @ 2024-12-06

108 downloads per month

MIT license

3KB

Text input library

A simple library for interactive text input in the terminal. It displays a message to the user and captures input synchronously, returning the entered text as a String (with spaces and line breaks removed). Ideal for CLI applications in Rust that need direct and clean user input.

Example:

use text_input::text;

fn main() {
    let name = text("What's your name? ");
    print!("Hi, {}", name);
}
$ cargo run

What's your name? Rust
Hi, Rust

No runtime deps