BSD-3-Clause licensed and maintained by Pat Brisbin
This version can be pinned in stack with:load-env-0.2.0.1@sha256:bf34e47f41170c2ac159b89fa792f377cb186031dd9c5def6350a9f405c2b169,1869

Module documentation for 0.2.0.1

  • LoadEnv
    • LoadEnv.Parse

load-env

Build Status

This is effectively a port of dotenv, whose README explains it best:

Storing configuration in the environment is one of the tenets of a twelve-factor app. Anything that is likely to change between deployment environments–such as resource handles for databases or credentials for external services–should be extracted from the code into environment variables.

But it is not always practical to set environment variables on development machines or continuous integration servers where multiple projects are run. dotenv loads variables from a .env file into ENV when the environment is bootstrapped.

This library exposes functions for doing just that.

Usage

import LoadEnv
import System.Environment (lookupEnv)

main :: IO ()
main = do
    loadEnv

    print =<< lookupEnv "FOO"
% cat .env
FOO=bar
% runhaskell main.hs
Just "bar"

Development & Test

stack setup
stack build --pedantic --test

CHANGELOG | LICENSE

Changes

TODO