Skip to content

Class: EnvVarBind

Defined in: packages/config-bound/src/bind/binds/envVar.ts:15

A Bind that retrieves the value of an environment variable.

Extends

Constructors

Constructor

ts
new EnvVarBind(options?): EnvVarBind;

Defined in: packages/config-bound/src/bind/binds/envVar.ts:27

Parameters

ParameterType
options?{ customEnvVarName?: (elementPath) => string; prefix?: string; }
options.customEnvVarName?(elementPath) => string
options.prefix?string

Returns

EnvVarBind

Overrides

Bind.constructor

Properties

PropertyModifierTypeDescriptionInherited fromDefined in
envVarPrefix?readonlystringThe prefix for the environment variable name-packages/config-bound/src/bind/binds/envVar.ts:19
namereadonlyBindName-Bind.namepackages/config-bound/src/bind/bind.ts:15

Methods

get()

ts
get<T>(sectionName, elementName): Promise<T | undefined>;

Defined in: packages/config-bound/src/bind/bind.ts:34

Gets the value from the bind for a specific element

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
sectionNamestringThe name of the Section
elementNamestringThe name of the Element

Returns

Promise<T | undefined>

The value of the element

Inherited from

Bind.get


retrieve()

ts
retrieve<T>(fullName): Promise<T | undefined>;

Defined in: packages/config-bound/src/bind/binds/envVar.ts:49

Retrieves the value of the environment variable

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
fullNamestringThe full name of the element in format sectionName.elementName

Returns

Promise<T | undefined>

The value of the environment variable.

Overrides

Bind.retrieve