This is a lightweight clone of various dotenv projects like this Haskell version or this JavaScript version.
A .env
file looks like this:
DATABASE_HOST=127.0.0.1
DATABASE_PORT=3131
DATABASE_USER=happydude
DATABASE_PASS=password
Simply drop the .env
file in the root of your project (ensuring for security reasons not to commit it), and then
call Dotenv.loadFile
at the beginning of your program. Environment variable lookups will then fall back to the
values defined in .env
.
To run the example:
pulp run -I example --main Example.Main