Skip to content

@saflib/env


Function: validateEnv()

validateEnv(env, envSchema): boolean

Given process.env and a schema, validate the environment variables. Throws an error if the environment variables are invalid. Run this when your service starts to ensure typedEnv conforms to the schema.

Parameters

ParameterType
envany
envSchemaany

Returns

boolean