Log konsol JS dengan warna
console.log('%c Oh my heavens! ', 'background: #222; color: #bada55');
If-dev
console.log('%c Oh my heavens! ', 'background: #222; color: #bada55');
console.log('%c My txt ', 'My css');
// Example
console.log('%c Hello world ', 'background: #222; color: #bada55');
// Download the npm package "colors"
// npm i colors
var colors = require("colors");
console.log("Hello World".blue);
// output: Hello World (Its blue btw lmao)
console.log(
'Nothing here %cHi Cat %cHey Bear', // Console Message
'color: blue',
'color: red', // CSS Style
);
//has to be backtick comma to interpolate.
public colorLogger(str: any, color = "red"){
console.log(`%c ${str}`, `color: ${color}; font-weight: bold;`);
}