dotenv
1 Usage Examples
2 API
dotenv-load!
dotenv-read
7.1

dotenv

Royall Spence <[email protected]>

 (require dotenv) package: dotenv

A library that allows for reading .env files instead of environment variables

1 Usage Examples

To load from .env to override your program’s environment variables, just use

To load multiple files, pass a list of filenames
(require dotenv)
(dotenv-load! '("raccoon.env"  "possum.env"))

To return an environment variable set without overwriting the current environment variables, use dotenv-read
(require dotenv)
(define other-env (dotenv-read '("raccoon.env"  "possum.env")))

2 API

procedure

(dotenv-load! filenames)  (listof boolean?)

  filenames : (listof string?)
Loads the .env file from the current directory and replaces the current environment variables with the file’s contents. Optionally accepts a list of filenames. Return value represents success or failure of setting each var; every element should be #t.

procedure

(dotenv-read filenames)  environment-variables?

  filenames : (listof string?)
Loads a list of files from the current directory and replaces the current environment variables with the contents of the files. Return value is a new environment-variables?. Raises exception on failure.

Added in version 1.1 of package dotenv.