# envBool() function · @imqueue/pg-cache

Source: https://imqueue.org/api/pg-cache/latest/pg-cache.envbool/
Published: 2026-08-04
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/pg-cache 5.0.6 — generated reference, not hand-written

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:**

```typescript
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

