Installation
npm install cli-styler
Usage
In this example we will put cli-styler in the variable cs
.
var cs = ;
Clear screen
Clear the console screen.
cs;
Short console log
Prevent wrist injuries, use the short console log.
cs;
Write text
Write text to the console based on process.stdout.write
. Extra options are 'text alignment' and 'prevent new line after text'.
cs;cs /* Set the text alignment, prevent new line after text */;cs /* Same as writeText() */;cs;cs;
Write characters (loop)
Write characters in a loop to the console. Handy to write multiple spaces or line breaks. Internal used in writeText()
for positioning text. Also available as get function.
cs;cs /* Same as writeCharacters() */;cs /* Get character */;cs;
Get width and height
Return width and height.
cs;cs;
Write rule
Write a rule to the console. Choose your own character and size. By default the rule has the full width of your console and does not prevent a new line.
cs;cs /* Set character */;cs /* Set character, size and prevent new line after text */;