Class: EnvVarBind
Defined in: packages/core/src/bind/binds/envVar.ts:15
A Bind that retrieves the value of an environment variable.
Extends
Properties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
envVarPrefix? | readonly | string | The prefix for the environment variable name | - | packages/core/src/bind/binds/envVar.ts:19 |
name | readonly | BindName | - | Bind.name | packages/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
| Parameter | Type | Description |
|---|---|---|
sectionName | string | The name of the Section |
elementName | string | The name of the Element |
Returns
Promise<T | undefined>
The value of the element
Inherited from
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
| Parameter | Type | Description |
|---|---|---|
fullName | string | The full name of the element in format sectionName.elementName |
Returns
Promise<T | undefined>
The value of the environment variable.
Overrides
create()
ts
static create(options?): Promise<EnvVarBind>;Defined in: packages/core/src/bind/binds/envVar.ts:33
Creates an EnvVarBind.
Parameters
| Parameter | Type | Description |
|---|---|---|
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.