Crate anstream

Auto-adapting stdout / stderr streams

A portmanteau of "ansi stream"

AutoStream always accepts ANSI escape codes, [adapting to the user's terminal's capabilities][AutoStream].

Benefits

Available styling crates:

Example

#  #[cfg(feature = "auto")] {
use anstream::println;
use owo_colors::OwoColorize as _;

// Foreground colors
println!("My number is {:#x}!", 10.green());
// Background colors
println!("My number is not {}!", 4.on_red());
# }

And this will correctly handle piping to a file, etc

Modules

Structs

Enums

Functions

Type Aliases

Macros