API Reference
defineEnv(schema, config?)
Schema Options
| Option | Behavior |
|---|---|
| type | "string" | "number" | "boolean" | "enum" |
| defaultValue | Fallback if missing or empty string |
| validate | Custom function (v) => boolean | string |
| validValues | Required for "enum" |
| key | Maps schema key to process.env key |
| isSecret | Masks value in debug logs |
Config Options
loadEnv (boolean, default: false)
If true, calls
dotenv.config()before parsing.debugMode (boolean, default: false)
Logs all resolved variables with sources and masked secrets.
throw (boolean, default: true)
Immediately exit process on failure vs accumulating errors.