• A function that tries to retrieve an environment variable from the process.env object and, if it succeeds, validates that it is either "true" or "false", and, if so, returns it as a boolean value.

    Parameters

    • name: string

      The name of the environment variable to look for in process.env.

    Returns boolean

    A boolean corresponding to the environment variable's value.

    Throws

    An Error instance explaining that the variable was either not found or that it could not be parsed into a valid boolean.

    See

    asOptionalBoolean

    Note

    This function's input is case insensitive, which means that variations of true such as True and TRUE, to quote two examples, will also be treated as true. Moreover, T or t will be treated as true, and, similarly, F and f will be treated as false. Finally, 0 will be treated as false and 1 as true.

Generated using TypeDoc