envBool() function

Reads a boolean environment variable, accepting the human-friendly spellings 1/true/yes/on and 0/false/no/off (case-insensitive). The previous !!+value idiom parsed values like true as NaN, i.e. false.

Signature:

export declare function envBool(name: string, defaultValue?: boolean): boolean;

Parameters

Parameter

Type

Description

name

string

environment variable name

defaultValue

boolean

(Optional) used when unset or unrecognized

Returns:

boolean

Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.