Skip to content

Class: EnvVarBind

Defined in: packages/core/src/bind/binds/envVar.ts:15

A Bind that retrieves the value of an environment variable.

Extends

Properties

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

Methods

get()

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

Defined in: packages/core/src/bind/bind.ts:38

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/core/src/bind/binds/envVar.ts:62

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


create()

ts
static create(options?): Promise<EnvVarBind>;

Defined in: packages/core/src/bind/binds/envVar.ts:33

Creates an EnvVarBind.

Parameters

ParameterTypeDescription
options?{ customEnvVarName?: (elementPath) => string; prefix?: string; }Optional prefix or custom naming function.
options.customEnvVarName?(elementPath) => string-
options.prefix?string-

Returns

Promise<EnvVarBind>

A fully initialised EnvVarBind instance.