| Crates.io | prompt-input |
| lib.rs | prompt-input |
| version | 1.0.1 |
| created_at | 2025-01-24 20:49:38.421293+00 |
| updated_at | 2025-06-22 20:12:09.40242+00 |
| description | A simple and lightweight library for user input prompts in Rust, designed to make input handling straightforward. |
| homepage | |
| repository | https://github.com/Kaua-Klassmann/prompt-input |
| max_upload_size | |
| id | 1529948 |
| size | 6,239 |
A simple and lightweight Rust library for creating user input prompts. The library is designed to simplify input handling in CLI applications, providing a straightforward API to prompt users for input.
Add prompt-input to your Cargo.toml:
cargo add prompt-input
Here's a quick example of how to use prompt-input:
use prompt_input::prelude::*;
fn main() {
let name: String = String::prompt("Enter your name: ");
let age: Option<u8> = u8::prompt("Enter your age: ");
if age.is_none() {
println!("Hello {}!", name);
} else {
println!("Hello {}! You are {} years old.", name, age.unwrap());
}
}
Contributions are welcome! Feel free to open issues or submit pull requests on the GitHub repository.
This project is licensed under the MIT License. See the LICENSE file for details.