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
| Parameter | Type |
|---|---|
options? | { customEnvVarName?: (elementPath) => string; prefix?: string; } |
options.customEnvVarName? | (elementPath) => string |
options.prefix? | string |
Returns
EnvVarBind
Overrides
Properties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
envVarPrefix? | readonly | string | The prefix for the environment variable name | - | packages/config-bound/src/bind/binds/envVar.ts:19 |
name | readonly | BindName | - | Bind.name | packages/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
| 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/config-bound/src/bind/binds/envVar.ts:49
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.