docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
A lightweight formatter that produces styled console strings with separate color handling for standard output and error output.
level of 0, info and warn return plain strings without ANSI color sequences while keeping prefixes. @testlevel of 1, info wraps the message in a single color style while leaving the message text unchanged. @testerror uses styling bound to the error stream and still emits colored output when color support is forced on (e.g., FORCE_COLOR=1), even if stdout is limited to level 0. @testinfo, warn, and error return strings prefixed with their severity labels and apply different visual emphasis per severity. @testexport type FormatterOptions = {
level?: 0 | 1 | 2 | 3;
};
export type StreamFormatter = {
info(message: string): string;
warn(message: string): string;
error(message: string): string;
};
export function createStreamFormatter(options?: FormatterOptions): StreamFormatter;Provides terminal string styling and stream-aware color detection.