Members
(static) dependencies :Array.<string>
Class dependencies:
['app', 'evaluator']
.
Methods
setFromFile(file)
Set environment values from given file.
Parameters:
Name | Type | Description |
---|---|---|
file |
string | The .env file to load the specific environment variable from. |
all()
Get all loaded environment variables.
Returns:
The environment variables.
- Type
- object.<string, *>
get(key, defaultValueopt)
Get single environment variable.
Value will be automatically cast as null, a boolean, a number or a string.
The first valid value will be returned.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
key |
string | The environment variable name. | ||
defaultValue |
null | boolean | number | string |
<optional> |
null
|
The default value to use if the environment variable is not defined. |
Returns:
The environment variable value.
- Type
- boolean | null | number | string
has(key)
Check if environment variable was defined.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The environment variable name. |
Returns:
Indicates if the variable exists in environment.
- Type
- boolean