A simple package that includes all constants for console text decoration.
npm install consolecuteRED, GREEN and YELLOW and background color constants like BG_BLUE, BG_CYAN, and BG_WHITE. It also contains other text decoration constants for your console like ITALIC, BOLD and UNDERLINE. It has three functions, an RGB and BG_RGB function that creates strings for specific RGB values and a PRINT function that trims and allows you to apply styles to text you are printing to the console.
import {RED, BLUE, BG_WHITE, RESET } from 'consolecute';
console.log(${RED}This will print RED text.${RESET});
console.log(${BLUE}${BG_WHITE}Blue text on a white background.${RESET});
PRINT function
The PRINT function makes it fairly simple to color text and automatically reset it.
`
import { PRINT, RED, RESET } from 'consolecute';
PRINT('This will print in RED', RED);
`
It will also remove all the leading space from multi-line text for when you log from a function.
`
if( true ) {
PRINT(
);
}
`
Options
Here are a list of the colors and other options you can import:
Text color strings:
`
BLACK
RED
GREEN
YELLOW
BLUE
MAGENTA
CYAN
WHITE
RGB(r, g, b)
DEFAULT
`
Background color strings:
`
BG_BLACK
BG_RED
BG_GREEN
BG_YELLOW
BG_BLUE
BG_MAGENTA
BG_CYAN
BG_WHITE
BG_RGB(r, g, b)
BG_DEFAULT
`
Control strings:
`
RESET
BOLD
DIM
ITALIC
UNDERLINE
BLINK
REVERSE
HIDDEN
STRIKETHROUGH
DBL_UNDERLINE
DBL_BLINK
``