Console Colors 2
Getting Started
Install: npm i console-colors-2
List
Special ( .sp
/.special
)
what | usage |
---|
bold | .sp.bold |
underline | .sp.underline |
reset | .sp.reset |
Foreground & Background (.fg
/.foreground
& .bg
/.background
)
what | foreground usage (.fg /.foreground ) | background usage (.bg /.background ) |
---|
black | .fg.black | .bg.black |
red | .fg.red | .bg.red |
green | .fg.green | .bg.green |
yellow | .fg.yellow | .bg.yellow |
blue | .fg.blue | .bg.blue |
magenta | .fg.magenta | .bg.magenta |
cyan | .fg.cyan | .bg.cyan |
white | .fg.white | .bg.white |
Usage:
Foreground Color:
const colors = require("console-colors-2");
console.log(colors.fg.red+"test"+colors.sp.reset);
console.log(`${colors.fg.red}test${colors.sp.reset}`);
Background Color:
const colors = require("console-colors-2");
console.log(colors.bg.red+"test"+colors.sp.reset);
console.log(`${colors.bg.red}test${colors.sp.reset}`);