read-dotenv-files

This repository contains small scripts as well as instructions to read .env files in several languages.

View the Project on GitHub Baelfire18/read-dotenv-files

Swift Dotenv

For using it in swift first you have to have:

  1. A Swift version installed.

  2. Installed the SwiftDotEnv package.

For a .env file like this:

import DotEnv

let env = DotEnv(withFile: ".env")

let DB_NAME = env.get("DB_NAME")
print(DB_NAME)