API
#
animationCallbackIf the value returned is falsy, the animation will stop playing
Type: Function
#
ParametersReturns boolean
#
animationPlay an animation asynchronously
#
Parametersframes
array<string> Array of frames to playintervalTime
number How many milliseconds each frame should be shown for (optional, default1
)callback
animationCallback Function to run after the current frame is shown (optional, default()=>true
)clear
boolean Clear the animation after it's done playing (optional, defaultfalse
)
Returns number
#
clearClear the console
#
countLog the number of times the label has been counted
#
Parameterslabel
string (optional, default'default'
)
Returns number
#
cursorCursor control
#
hideHide the cursor
#
showShow the cursor
#
isHiddenCheck if the cursor is hidden
Returns boolean
#
toggleToggle the cursor
#
debugPrint a debugging message to the console
#
Parameterscontent
...string The content to be printed
Returns string
#
errorPrint an error to the console
#
Parameterscontent
...string The content to be shown as the error
Returns string
#
infoPrint an informational message to the console
#
Parameterscontent
...string
#
jsonPretty-print, highlight, and log some JSON to the console
#
Parametersjson
any Content to convert to JSON and logindentation
number How many spaces should be used for indentation (optional, default2
)
Returns string
#
logLog a string to the console
#
Parameterscontent
...string The content to log to the console
Returns string
#
newlineSemantic way of printing a newline character to stdout
#
Parametersrepeat
number How many new lines should be printed (optional, default1
)
#
progressPrint a progress bar
#
Parameterspercentage
number Progress bar percentage (optional, default100
)character
string Character used in progress bar (optional, default'\u2588'
)columns
number (optional, defaultprocess.stdout.columns
)
Returns string
#
timestampLog to the console with a timestamp
#
Parameterson
boolean Truthy or falsy value that determines if the timestamp will be logged
Returns boolean