Marak / colors.js

get colors in your node.js console
https://github.com/Marak/colors.js
Other
5.16k stars 446 forks source link

Passing colors as arguments #252

Open seahindeniz opened 5 years ago

seahindeniz commented 5 years ago

Whenever I tried to pass colored strings as an argument to another function to print logs, it always returns with unknown characters instead of colorized strings.

function Write() {
  Log(Colors.yellow("testing"), ` successful`);
}

function Log(...args) {
  console.log(`${Colors.cyan("Hello")} >`, ...args)
}

and the results image

What is the best possible solution for this problem?