Skip to content

Latest commit

 

History

History
83 lines (53 loc) · 2.87 KB

index.md

File metadata and controls

83 lines (53 loc) · 2.87 KB

UpdateManager

Accessors

  • get lastLength(): number - Last printed rows count
  • get outside(): number - Rows count outside editable area
  • get isHooked(): boolean - Hook activity status
  • get isSuspended(): boolean - Suspend status for active hooks

Methods

getInstance

Method to get the object to control the streams update

static getInstance(
  stdout: NodeJS.WriteStream = process.stdout,
  stderr: NodeJS.WriteStream = process.stderr
): UpdateManager

Parameters

Name Type Description
stdout WriteStream process.stdout
stderr WriteStream process.stderr

erase

Removes from the bottom of output up the specified count of lines

Parameters

Name Type Description
count number | undefined number of lines to remove

hook

Hook stdout and stderr streams

resume

Resume suspend hooks

Parameters

Name Type Description
eraseRowCount number | undefined erase output rows count

suspend

Suspend active hooks for external output

Parameters

Name Type Description
erase boolean erase output

unhook

Unhooks both stdout and stderr streams and print their story of logs

Parameters

Name Type Description
separateHistory boolean Default true, if true, will add an empty line to the history output for individual recorded lines and console logs

update

Update output

Parameters

Name Type Description
rows string[] Text lines to write to standard output
from number | undefined Default 0, index of the line starting from which the contents of the terminal are being overwritten