Skip to main content

getNumbers(...variableNames): number[]

Defined in: src/config-manager/getters.ts:58

Retrieves and validates multiple numeric environment variables. Each variable is validated using the same criteria as getNumber. Parses string values to numbers and validates they're not NaN.

Parameters

variableNames

...string[]

The names of the environment variables to retrieve

Returns

number[]

An array of numeric values parsed from the environment variables

Throws

When any environment variable is missing, not a valid number, or contains only whitespace

Example

// Environment: PORT=3000, TIMEOUT=30.5, MAX_CONNECTIONS=100
const [port, timeout, maxConnections] = getNumbers('PORT', 'TIMEOUT', 'MAX_CONNECTIONS');
// Returns: [3000, 30.5, 100]