ConsoleStyle is a utility module for enhancing your Node.js terminal output. based in the new styleText utility of node. It provides a flexible and chainable interface for styling text with various colors, backgrounds, and formats.
You can install ConsoleStyle via npm:
npm i console-style-text
use .log()
to print the text, also you can add color, background or format
//use with commonJS
const {consoleStyle} = require('console-style-text')
//or ES module
import { consoleStyle } from 'console-style-text'
// normal print
consoleStyle('text sample').log()
// print with color
consoleStyle('text sample').color('red').log()
// print with background
consoleStyle('text sample').bg('bgRed').log()
// print with format
consoleStyle('text sample').format('bold').log()
black, red, green, yellow, blue, magenta, cyan, white, gray redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright
bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bgGray bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright
bold, italic, underline, strikethrough, hidden, dim, overlined, blink, inverse doubleunderline, framed