Skip to content

Commit

Permalink
Disable color output if $NO_COLOR is set
Browse files Browse the repository at this point in the history
  • Loading branch information
lafkpages committed Oct 17, 2023
1 parent 3afb65b commit 10da0ea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/log/colors.ts
Expand Up @@ -9,6 +9,10 @@ let colors: typeof import("ansi-colors");

try {
colors = await import("ansi-colors");

if (process.env.NO_COLOR) {
colors.enabled = false;
}
} catch {
// If ansi-colors is not installed, return a proxy that returns itself
// when any property is accessed
Expand Down

0 comments on commit 10da0ea

Please sign in to comment.