Skip to content

You're viewing documentation for a pre-release version. View the latest stable version

Type Method

load(for:)

Reads the dotenv files relevant to the environment and loads them into the process.
static func load(for environment: Environment = .development) async

Parameters

environment

Current environment, selects which .env file to use.

Discussion

let environment: Environment
try await DotEnvFile.load(for: .development)
print(Environment.process.FOO) // BAR