Framework: packages: screen - x684867/nemesis_server GitHub Wiki

PURPOSE:

This package creates a global screen management package for writing output through
console.log() to the terminal.  The screen object extends the functionality of the
console object by adding a process.on('resize') event, line-drawing methods and other
pretty output features.

DEPENDENCIES:

console
process

FILES:

Filename Description
config.json Configuration file (reserved for future use)
errors-[LOCALIZED LANGUAGE].json Localized error strings file
messages-[LOCALIZED LANGUAGE].json Localized general messages file
main.js Main package executable, containing activeJSON code

DESIGN NOTES

  • This package is intended to provide a "pretty" way of writing output from the application. By default this class will write all output to the screen using the console object. However, this class can also be overloaded by packages such as error and logger to output information to log files or syslog, etc.

  • The package includes line-drawing and timestamp functionality as well as a means of clearing a screen.

  • If the screen (terminal) is resized during run-time, this package is "smart" and will alter its internal geometry state accordingly.

Fully Qualified Method Name Arguments Description
root.screen.write(message) message:string
Writes message to stdout using console.
root.screen.log(message) message:string
Writes a time-stamped log message to stdout using root.screen.write().
root.screen.repeat(s,n) s:string to be printed to stdout
n:integer representing number of times string (s) should be printed.
This method repeats a given string (s) some number (n) times on stdout.
root.screen.drawSingleLine() Draw a "single-line" string using the "-" character repeated across the current terminal width.
root.screen.drawDoubleLine() Draw a "double-line" across the current width of the terminal using the "=" character.
root.screen.drawDottedLine() Draw a "dotted line" across the current screen width using the "." character.
root.screen.clear() Clear the screen by filling it with line-feed characters ('\n').
root.screen.screen.now() Returns a current timestamp uniformly formatted as YYYY/MM/DD@HH:mm:ss
⚠️ **GitHub.com Fallback** ⚠️