@termun/core - v0.0.0
    Preparing search index...

    Class Env

    Index

    Constructors

    • Creates a new Env instance and immediately loads settings from .env file. All defaults are hardcoded static values; consumer .env overrides apply at runtime.

      Returns Env

    Methods

    • Helper: extracts a string from env, returning undefined if empty.

      Parameters

      • Optionalvalue: string

      Returns string | undefined

    • Helper: converts a string or boolean to a boolean, handling "true"/"false" strings.

      Parameters

      • Optionalvalue: string | boolean

      Returns boolean | undefined

    • Reloads settings from the .env file and re-applies all values.

      Returns this

      this for chaining.

    • Returns the raw debug log flag.

      Returns boolean

    • Sets the debug log flag from a boolean or env string.

      Parameters

      • Optionalvalue: string | boolean

        Boolean or "true"/"false" string. Falls back to the class default if omitted.

      Returns this

    • Returns true when debug file logging is active.

      Returns boolean

    • Returns the current default language code.

      Returns string

    • Sets the default language. Falls back to the class default if value is empty.

      Parameters

      • Optionalvalue: string

        Language code string.

      Returns this

    • Returns the idle state prefix string.

      Returns string

    • Sets the idle state prefix. Falls back to the default if empty.

      Parameters

      • Optionalvalue: string

      Returns this

    • Returns the idle state color, or undefined to use the terminal default.

      Returns ColorName | undefined

    • Sets the idle state color. Pass undefined or empty to use the terminal default.

      Parameters

      • Optionalvalue: string

      Returns this

    • Returns the hover state prefix string.

      Returns string

    • Sets the hover state prefix. Falls back to the default if empty.

      Parameters

      • Optionalvalue: string

      Returns this

    • Returns the hover state color, or undefined to use the terminal default.

      Returns ColorName | undefined

    • Sets the hover state color. Pass undefined or empty to use the terminal default.

      Parameters

      • Optionalvalue: string

      Returns this

    • Returns the selected state prefix string.

      Returns string

    • Sets the selected state prefix. Falls back to the default if empty.

      Parameters

      • Optionalvalue: string

      Returns this

    • Returns the selected state color, or undefined to use the terminal default.

      Returns ColorName | undefined

    • Sets the selected state color. Pass undefined or empty to use the terminal default.

      Parameters

      • Optionalvalue: string

      Returns this

    • Returns whether the idle state applies underline decoration.

      Returns boolean

    • Sets the idle underline flag. Accepts a boolean or "true"/"false" string.

      Parameters

      • Optionalvalue: string | boolean

      Returns this

    • Returns true if idle underline decoration is active.

      Returns boolean

    • Returns whether the hover state applies underline decoration.

      Returns boolean

    • Sets the hover underline flag. Accepts a boolean or "true"/"false" string.

      Parameters

      • Optionalvalue: string | boolean

      Returns this

    • Returns true if hover underline decoration is active.

      Returns boolean

    • Returns whether the selected state applies underline decoration.

      Returns boolean

    • Sets the selected underline flag. Accepts a boolean or "true"/"false" string.

      Parameters

      • Optionalvalue: string | boolean

      Returns this

    • Returns true if selected underline decoration is active.

      Returns boolean

    • Returns the default page size for scrollable choice menus.

      Returns number

    • Sets the default page size from a number or env string. Falls back to the class default (10) if the value is missing or invalid.

      Parameters

      • Optionalvalue: string | number

        Number or numeric string.

      Returns this

    Properties

    debugLog: boolean
    language: string
    idlePrefix: string
    idleColor?: ColorName
    hoverPrefix: string
    hoverColor?: ColorName
    selectedPrefix: string
    selectedColor?: ColorName
    idleUnderline: boolean
    hoverUnderline: boolean
    selectedUnderline: boolean
    pageSize: number
    defaultDebugLog: boolean = false
    defaultLanguage: string = "en"
    defaultIdlePrefix: string = " "
    defaultIdleColor: ColorName | undefined = undefined
    defaultHoverPrefix: string = "❯"
    defaultHoverColor: ColorName | undefined = undefined
    defaultSelectedPrefix: string = ""
    defaultSelectedColor: ColorName | undefined = undefined
    defaultIdleUnderline: boolean = false
    defaultHoverUnderline: boolean = false
    defaultSelectedUnderline: boolean = false
    defaultPageSize: number = 10