Class: Terminal
Constructors
new Terminal(wo, level, format, tty)
new Terminal(
wo
,level
?,format
?,tty
?):Terminal
Parameters
• wo: WorkerOutput
• level?: WorkerLogLevel
• format?: string
• tty?: boolean
= process.stdout.isTTY
Returns
Source
Properties
_refresh?
_refresh?:
Timeout
Source
format?
format?:
string
Source
hasProgress
hasProgress:
boolean
=false
Source
height
height:
number
=process.stdout.rows
Source
history
history:
string
[] =[]
Source
historySize
historySize:
number
=2000
Source
inputValid
inputValid:
boolean
=true
Source
inputValue
inputValue:
string
=""
Source
inputs
inputs:
WorkerInput
[] =[]
Source
level
level:
WorkerLogLevel
Source
listener
listener: (
msg
) =>void
Contains the WorkerOutput listener
Parameters
• msg: WorkerMessage
Returns
void
Source
logo
logo:
string
[] =[]
Source
logoWidth
logoWidth:
number
=0
Source
progressChar
progressChar:
number
=0
Source
progressChars
progressChars:
string
[]
Source
progresses
progresses:
Object
={}
Index signature
[key
: string
]: WorkerProgress
Source
reset
reset:
boolean
=false
Source
rl?
rl?:
Interface
Source
scrollY
scrollY:
number
=-1
Source
title
title:
string
=""
Source
tty
tty:
boolean
Source
width
width:
number
=process.stdout.columns
Source
wo
wo:
WorkerOutput
Source
refreshSpeed
static
refreshSpeed:number
=300
Source
Methods
clearScreen()
clearScreen():
void
Returns
void
Source
close()
close():
void
Returns
void
Source
displayBar()
displayBar(
ratio
,barlen
):string
Parameters
• ratio: number
• barlen: number
Returns
string
Source
displayFooter()
displayFooter():
string
Returns
string
Source
displayHistory()
displayHistory(
lines
,complete
):string
Parameters
• lines: number
• complete: boolean
= true
Returns
string
Source
displayProgress()
displayProgress(
p
):string
Parameters
• p: WorkerProgress
Returns
string
Source
displayScreen()
displayScreen():
Promise
<void
>
Returns
Promise
<void
>
Source
displayString()
displayString(
str
,limit
):string
Parameters
• str: string
• limit: number
= undefined
Returns
string
Source
displayTitle()
displayTitle():
string
Returns
string
Source
getBar()
getBar(
size
,complete
):string
Parameters
• size: number
• complete: boolean
Returns
string
Source
getFooterSize()
getFooterSize():
number
Returns
number
Source
getLogo()
getLogo():
string
[]
Retrieve current logo
Usefull to add some versions
Returns
string
[]
Source
getTrueLength()
getTrueLength(
str
):number
Parameters
• str: string
Returns
number
Source
handleTitleMessage()
handleTitleMessage(
msg
):void
Parameters
• msg: WorkerMessage
Returns
void
Source
log()
log(
groups
,level
, ...args
):void
Parameters
• groups: any
[]
• level: WorkerLogLevel
• ...args: any
[]
Returns
void
Source
onData()
onData(
data
):void
Parameters
• data: string
| Buffer
Returns
void
Source
pushHistory()
pushHistory(
line
):void
Parameters
• line: string
Returns
void
Source
resetTerm()
resetTerm():
void
Returns
void
Source
resize()
resize():
void
Returns
void
Source
router()
router(
msg
):Promise
<void
>
Parameters
• msg: WorkerMessage
Returns
Promise
<void
>
Source
scrollDown()
scrollDown(
increment
):void
Parameters
• increment: number
Returns
void
Source
scrollUp()
scrollUp(
increment
):void
Parameters
• increment: number
Returns
void
Source
setLogo()
setLogo(
logo
):void
Set the logo to display
How to create logo:
Parameters
• logo: string
[]
to display
Returns
void
Source
setTitle()
setTitle(
title
):void
Parameters
• title: string
= ""
Returns
void
Source
stripColorString()
stripColorString(
str
,limit
):string
Parameters
• str: string
• limit: number
= -1
Returns
string