API
animationCallback#
If the value returned is falsy, the animation will stop playing
Type: Function
Parameters#
Returns boolean
animation#
Play an animation asynchronously
Parameters#
framesarray<string> Array of frames to playintervalTimenumber How many milliseconds each frame should be shown for (optional, default1)callbackanimationCallback Function to run after the current frame is shown (optional, default()=>true)clearboolean Clear the animation after it's done playing (optional, defaultfalse)
Returns number
clear#
Clear the console
count#
Log the number of times the label has been counted
Parameters#
labelstring (optional, default'default')
Returns number
cursor#
Cursor control
hide#
Hide the cursor
show#
Show the cursor
isHidden#
Check if the cursor is hidden
Returns boolean
toggle#
Toggle the cursor
debug#
Print a debugging message to the console
Parameters#
content...string The content to be printed
Returns string
error#
Print an error to the console
Parameters#
content...string The content to be shown as the error
Returns string
info#
Print an informational message to the console
Parameters#
content...string
json#
Pretty-print, highlight, and log some JSON to the console
Parameters#
jsonany Content to convert to JSON and logindentationnumber How many spaces should be used for indentation (optional, default2)
Returns string
log#
Log a string to the console
Parameters#
content...string The content to log to the console
Returns string
newline#
Semantic way of printing a newline character to stdout
Parameters#
repeatnumber How many new lines should be printed (optional, default1)
progress#
Print a progress bar
Parameters#
percentagenumber Progress bar percentage (optional, default100)characterstring Character used in progress bar (optional, default'\u2588')columnsnumber (optional, defaultprocess.stdout.columns)
Returns string
timestamp#
Log to the console with a timestamp
Parameters#
onboolean Truthy or falsy value that determines if the timestamp will be logged
Returns boolean