Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • ProcessUtil

Index

Methods

Static getEnvironment

  • Helper method that gets the EnvironmentType from the node process. The environment type returned is
    calculated using the value stored in process.env.NODE_ENV. If there is no value present, defaults to
    EnvironmentType.DEVELOPMENT.

    static
    throws

    {Error} An error is thrown when a string that does not map to a valid EnvironmentType is stored in
    the process.env.NODE_ENV.

    Returns EnvironmentType

    An EnvironmentType associated with the current application runtime environment.

Static getLogLevelThreshold

  • Helper method that gets the log level current set as the log level threshold for what is sent to the console
    during runtime. The log level returned is calculated using the value stored in process.env.LOG_THRESHOLD.
    If there is no value present, defaults to LogLevelType.INFO.

    static
    throws

    {Error} An error is thrown when a string that does not map to a valid LogLevelType is stored in
    process.env.LOG_THRESHOLD.

    Returns LogLevelType

    A LogLevelType associated with the current application log threshold.

Static setCurrentWorkingDirectory

  • setCurrentWorkingDirectory(directory: string): void
  • Sets the node process's current work directory.

    see

    process.chdir()

    static
    throws

    {Error} An error is thrown if the working directory is unable to be changed for any reason.

    Parameters

    • directory: string

      The directory to set as the current working directory.

    Returns void

Static setEnvironment

  • Sets the node process's NODE_ENV variable, which is used to indicate what environment the process is
    currently running in.

    static
    throws

    {Error} An error is thrown when an unsupported EnvironmentType is provided. If an environment type is
    not included in the EnvironmentType.SUPPORTED_TYPES array, it will result in an error being thrown.

    Parameters

    • environmentType: EnvironmentType

      The environment to set the application as running on.

    Returns void

Static setLogLevelThreshold

  • setLogLevelThreshold(logLevelType: LogLevelType): void
  • setLogLevelThreshold(logLevel: "debug" | "info" | "warn" | "error" | "fatal"): void
  • Sets the node process' LOG_THRESHOLD variable, which is used to indicate what log levels are displayed to the
    console during application runtime.

    static
    throws

    {Error} An error is thrown when an unsupported LogLevelType is provided. If a log level is not
    included in the LogLevelType.SUPPORTED_TYPES array, it will result in an error being thrown.

    Parameters

    • logLevelType: LogLevelType

      A LogLevelType that indicates what level of logs and higher that
      should be displayed on the console.

    Returns void

  • Sets the node process' LOG_THRESHOLD variable, which is used to indicate what log levels are displayed to the
    console during application runtime.

    static
    throws

    {Error} An error is thrown when an unsupported LogLevelType is provided. If a log level is not
    included in the LogLevelType.SUPPORTED_TYPES array, it will result in an error being thrown.

    Parameters

    • logLevel: "debug" | "info" | "warn" | "error" | "fatal"

      A string that indicates what level of logs
      and higher that should be displayed on the console.

    Returns void

Constructors

constructor

Generated using TypeDoc