Skip to content

Latest commit

 

History

History

julia

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Julia

  1. You'll need a working Julia installation.
  2. You'll need the DotEnv.jl package, installable using Pkg:
Pkg.add("DotEnv")

Or through the REPL by writing ] add DotEnv.

This packages includes a DotEnv.config function that loads a .env file into the global ENV dictionary, allowing the same access pattern as normal environment variables.

using DotEnv

DotEnv.config()

Which allows us to simply access environment variables directly:

db_name = ENV["DB_NAME"]
println(db_name)