dotenv-micro-0.1.0.1: Tiny dotenv library
Safe HaskellSafe-Inferred
LanguageHaskell2010

DotEnv.Micro

Description

Tiny library for handling environment variables stored in .env files.

File format

.env files are plain text UTF-8 files with rows of the form:

KEY=VALUE

The rows are separated by newline and the KEYs must not contain any equal sign.

The VALUE strings on the other hand can contain equal signs (the string is ingested up to the newline).

NB: Currently this library does not support variables.

Important

Add the paths of your .env files to the .gitignore file or equivalent, so that they are not checked into source control.

Synopsis

Documentation

loadDotEnv Source #

Arguments

:: MonadIO m 
=> Maybe FilePath

defaults to .env in the Cabal project base directory if Nothing.

-> m () 

Load, parse and apply a .env file

NB : does not overwrite any preexisting env vars.

NB2 : if the given .env file is not found or cannot be parsed the program crashes with fail.