Options
All
  • Public
  • Public/Protected
  • All
Menu

ConsoleManager class

see

constructor()

Hierarchy

  • ConsoleManager

Index

Constructors

constructor

  • An improved console class that implements useful methods for the console output

    Returns ConsoleManager

    A ConsoleManager instance

Properties

colorError

colorError: string = "%s"

Defines the color to be used on the error styled console texts

colorSuccess

colorSuccess: string = "%s"

Defines the color to be used on the success styled console texts

colorTitle

colorTitle: string = "%s"

Defines the color to be used on the title styled console texts

colorWarning

colorWarning: string = "%s"

Defines the color to be used on the warning styled console texts

Methods

error

  • error(message: string, quit?: boolean): void
  • Show an error to the user

    Parameters

    • message: string

      The text to show as an error

    • Default value quit: boolean = true

      True by default, the application will die when the error message is shown with error code 1 (which means exit with error)

    Returns void

    void

errors

  • errors(messages: string[], quit?: boolean): void
  • Show a multiple list of errors to the user, one after the other on a new line.

    Parameters

    • messages: string[]

      The list of texts to show as errors

    • Default value quit: boolean = true

      True by default, the application will die with error code 1 (which means exit with error) after the last error is displayed

    Returns void

    void

success

  • success(message: string, quit?: boolean): void
  • Show a success to the user If quit parameter is true, the application will also exit with success code 0 (which means exit without error)

    Parameters

    • message: string
    • Default value quit: boolean = false

    Returns void

text

  • text(message: string): void
  • Show a standard message to the user with the default console raw text style

    Parameters

    • message: string

    Returns void

title

  • title(message: string): void
  • Show a title message to the user

    Parameters

    • message: string

    Returns void

warning

  • warning(message: string, quit?: boolean): void
  • Show a warning to the user If quit parameter is true, the application will also exit with error code 1 (which means exit with error)

    Parameters

    • message: string
    • Default value quit: boolean = false

    Returns void

warnings

  • warnings(messages: string[], quit?: boolean): void
  • Show a multiple list of warnings to the user, one after the other on a new line.

    Parameters

    • messages: string[]

      The list of texts to show as warnings

    • Default value quit: boolean = false

      False by default, the application will die with error code 1 (which means exit with error) after the last warning is displayed

    Returns void

    void

Generated using TypeDoc