Skip to main content

Function: loadConfigOrExit()

loadConfigOrExit<S>(options, io?): Promise<LoadedConfig<StaticType<[], "Encode", { }, { }, S>>>

Defined in: packages/config/src/load.ts:171

Loads configuration for a process entry point: on failure, prints the problems to stderr and exits non-zero, which is what a container orchestrator reads as "this deployment is misconfigured, do not retry as if it were a transient fault".

Type Parameters​

S​

S extends TObject<TProperties>

Parameters​

options​

LoadConfigOptions<S>

io?​

Replaces stderr and exit, so the refusal path can be tested.

exit?​

(code) => never

stderr?​

(text) => void

Returns​

Promise<LoadedConfig<StaticType<[], "Encode", { }, { }, S>>>