I'm writing a framework I have a problem:
When i use .pipe
to filter the error message from runProcess.stderr
of spawn
i can't find its error message color and it's just white
How can i display error message with color or parse
message into Error
object (this error message is Error message of javascript)
CodePudding user response:
You can change the color of text in the terminal by prepending an ascii color code. For instance \u001b[31m
would change the text color to red.
console.log("\u001b[31mHello World");
// Will print "Hello World" in red
CodePudding user response:
I need it to look like this from string