| Crates.io | luhcore |
| lib.rs | luhcore |
| version | 0.0.1 |
| created_at | 2025-11-12 02:21:40.320618+00 |
| updated_at | 2025-11-12 02:21:40.320618+00 |
| description | the core library for the luh ecosystem |
| homepage | |
| repository | https://github.com/calizoots/luhcore |
| max_upload_size | |
| id | 1928691 |
| size | 63,276 |
luhcore is a small utility crate providing core functionality commonly needed in my applications, including:
Colorise], [Style], [StyledText], and [Color].dirs::AppDirs].is_ci(), is_debug_build(), and is_release_build().color]: Extension trait for coloring strings and styled text.style]: Core style types (Style, StyledText, Color) and styling logic.dirs]: Application directories handling (AppDirs) for config, cache, temp files, etc.Terminal text styling
Apply foreground/background colors, bold, underline, and dim effects using a convenient trait interface.
Environment detection
Check if running in a CI environment, or whether the build is a debug or release build.
Cross-platform directories
Create and manage app-specific config, cache, and temporary directories, including development temp files.
use luhcore::Colorise;
println!("{}", "error".red().bold());
println!("{}", "warning".yellow().underline());
println!("{}", "success".green().on_white().dim());
use luhcore::{is_ci, is_debug_build};
if is_ci() {
println!("Running in CI environment");
}
if is_debug_build() {
println!("Running in debug mode");
}
use luhcore::dirs::AppDirs;
fn main() -> std::io::Result<()> {
let dirs = AppDirs::for_app("luhcore")?;
dirs.ensure_all()?;
println!("Config dir: {}", dirs.config.display());
println!("Cache dir: {}", dirs.cache.display());
println!("Temp dir: {}", dirs.temp.display());
let temp_file = dirs.dev_temp_file("example.txt");
println!("Development temp file path: {}", temp_file.display());
Ok(())
}
made with love s.c 2025 :)