Documentation
    Preparing search index...

    Class EnvConfigSource

    Configuration source reading from process environment variables. Translates dot-notation paths (e.g. 'database.host') to environment naming (e.g. 'DATABASE_HOST').

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _env: Map<string, string | undefined>
    _prefix: string
    name: string

    Human-readable identifier for this configuration source.

    priority: number

    Numeric priority level used for resolution ordering. Higher priority sources override lower priority ones.

    Methods

    • Appends prefixed candidates when a namespace prefix is defined.

      Parameters

      • candidates: Set<string>
      • key: string
      • snakeKey: string

      Returns void

    • Internal helper generating candidate environment variable names.

      Parameters

      • key: string

      Returns string[]

    • Converts camelCase, dot-notation, or kebab-case into UPPER_SNAKE_CASE.

      Parameters

      • key: string

      Returns string

    • Retrieves an environment variable. Checks the following formats in order:

      1. Exact key as passed
      2. Key with configured prefix (if any)
      3. Dot-notation converted to UPPER_SNAKE_CASE (e.g. 'api.host' -> 'API_HOST')
      4. Dot-notation converted with prefix (e.g. 'api.host' -> 'PREFIX_API_HOST')

      Parameters

      • key: string

        Property key or dot-notation path.

      Returns string | undefined

      String value if defined and non-empty, or undefined.

    • Returns all environment key-value pairs matching this source.

      Returns Record<string, unknown>

    • Checks whether any candidate key exists in the environment.

      Parameters

      • key: string

        Property key or dot-notation path.

      Returns boolean