console-style-text v1.0.2
ConsoleStyle
Abstracted styleText Utility for Enhanced Text Styling in Node.js
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.
Installation
You can install ConsoleStyle via npm:
npm i console-style-text
Usage
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()
Available Colors: .color(colorName)
black, red, green, yellow, blue, magenta, cyan, white, gray redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright
Available Background Colors: .bg(bgColorName)
bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bgGray bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright
Available Formats: .format(formatName)
bold, italic, underline, strikethrough, hidden, dim, overlined, blink, inverse doubleunderline, framed