dotenv

2021-12-09

Ease pain with working with .env files.

Upstream URL

github.com/vityafx/dotenv

Author

Victor Polevoy <fx@thefx.co>

License

MIT
README

dotenv

This is a project to parse dotenv (.env) files. You already know what that means, don't you?

Description

This project provides all the necessary functions for interaction with dotenv files (usually it is .env).

API

dot-env-load!

The function's prototype is:

(defun dot-env-load! (&optional names)

It reads the dotenv files provided in the optional list or reads only .env file is the list is empty or was not provided.

Usage:

;; Loads the `.env` only because the arguments list is empty.
(dot-env-load!)
;; Loads the provided files.
(dot-env-load! '(".env" "test.env"))

dot-env

The function's prototype is:

(defun dot-env (name &optional default)

It reads the value of a variable dotenv with passed name. If there is no such a variable there, it reads the process environment. If there is nothing too, it returns default or NIL.

Usage:

(dot-env-load!)
(dot-env "HOME")

License

MIT license

Dependencies (2)

  • cl-str
  • prove

Dependents (0)

    • GitHub
    • Quicklisp