1.0.2 • Published 3 years ago
format-txt v1.0.2
Format text when printing to the terminal!
/*
* Examples
*/
const { logln } = require("format-txt");
logln("Text with no formatting");
logln("<red>Red text</red>");
logln("<red;ul>Underlined red text</red;ul>");
logln("<blue;ul>Underlined blue text</blue> Underlined text</ul>");
logln("--\\> <yellow>Yellow text</yellow> \\<--");Every > or < which isn't being used for formatting must be prefixed with \\
Functions:
formatTxt(txt)Formats then returns the supplied text.log(txt)Formats then logs the supplied text.logln(txt)Formats then logs the supplied text with a newline.
Available formats: Text Formats:
bolddimitalicunderline/ulflashing/flashstrikethrough/st
Text Colours:
blackredgreenyellowbluepurplecyanwhite
Hight Intensity Text Colours:
blackHredHgreenHyellowHblueHpurpleHcyanHwhiteH
Background colours:
blackBredBgreenByellowBblueBpurpleBcyanBwhiteB
High Intensity Background Colours:
blackHBredHBgreenHByellowHBblueHBpurpleHBcyanHBwhiteHB