Change Colors in Angular CLI

angular, command-line-interface

Solution

The easiest way to do it is to change characters in the output stream of the application that controls the color.

Linux bash:

ng serve | tr $INPUTCOLOR $OUTPUTCOLOR

or

ng serve | sed -r "s/$INPUTCOLOR/$OUTPUTCOLOR/g'

Windows PowerShell:

ng serve | ForEach-Object { $_ -replace $INPUTCOLOR, $OUTPUTCOLOR }

The `$INPUTCOLOR` and `$OUTPUTCOLOR` is needed to be set to run the code. This way every red foreground color can be changed with red background and white foreground color.

Problem

The script that starts my Angular CLI development Web server produces almost illegible error messages, such as the following.[] I would much prefer something like this:[ Before I start digging into the oodles of configuration files associated with my Angular/CLI installation, I thought that I would start by asking for directions.

Original source