Constructors
PlatformEnv()
Setting the env_options, is_silent, and logger properties of the PlatformEnv class, and then it is loading the environment variables
Properties
env_options: LoadOptions
logger
Methods
delete(key: TPlatformEnvKvKey)
The function deletes a key from the environment and reloads the environment if the deletion is successful.
get(key: TPlatformEnvKvPair["key"]): string
The function retrieves the value of a specific key from the environment, or returns the entire environment if the key is undefined.
set(pairs: TPlatformEnvKvPair)
The function sets a key-value pair, logs the action, writes the pair to storage, and reloads the environment if the write operation is successful.
Static Properties
mode: TPlatformMode
It returns the value of the PLATFORM_MODE
environment variable,
or dev
if the variable is not set
version: string
It reads the VERSION file in the platform directory and returns its contents. If the file doesn't exist, it returns the value of the PLATFORM_MODE environment variable. If that doesn't exist, it returns "0.1#na"
Constructors
PlatformEnv()
Setting the env_options, is_silent, and logger properties of the PlatformEnv class, and then it is loading the environment variables
Properties
env_options: LoadOptions
logger
Methods
delete(key: TPlatformEnvKvKey)
The function deletes a key from the environment and reloads the environment if the deletion is successful.
get(key: TPlatformEnvKvPair["key"]): string
The function retrieves the value of a specific key from the environment, or returns the entire environment if the key is undefined.
set(pairs: TPlatformEnvKvPair)
The function sets a key-value pair, logs the action, writes the pair to storage, and reloads the environment if the write operation is successful.
Static Properties
mode: TPlatformMode
It returns the value of the PLATFORM_MODE
environment variable,
or dev
if the variable is not set
version: string
It reads the VERSION file in the platform directory and returns its contents. If the file doesn't exist, it returns the value of the PLATFORM_MODE environment variable. If that doesn't exist, it returns "0.1#na"