API Reference
    Preparing search index...
    type GetBooleanFromEnvOptions = {
        defaultValue?: boolean;
        errorMessage?: string;
        extendedParsing?: boolean;
        key: string;
    }
    Index

    Properties

    defaultValue?: boolean

    The default value to return if the environment variable is not set.

    undefined
    
    errorMessage?: string

    Optional error message to throw if the environment variable is not set and no default value is provided.

    "Environment variable <key> is required"
    
    extendedParsing?: boolean

    Whether to extend the parsing of the boolean value to include common string representations.

    The following values are considered true:

    • "true"
    • "1"
    • "yes"
    • "on"
    • "y"

    The following values are considered false:

    • "false"
    • "0"
    • "no"
    • "off"
    • "n"
    false
    
    key: string

    The key of the environment variable.