console-style-text

1.0.2 • Public • Published

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

Package Sidebar

Install

npm i console-style-text

Weekly Downloads

5

Version

1.0.2

License

MIT

Unpacked Size

5 kB

Total Files

4

Last publish

Collaborators

  • jairolopezlon