The cl-env Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-env Reference Manual

This is the cl-env Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 03:37:06 2022 GMT+0.

Table of Contents


1 Introduction

cl-env

cl-env is a project for loading environment variables from .env files into the current environment. Storing configuration in the environment separate from code is based on The Twelve-Factor App methodology.

Calling (cl-env:init) will attempt to load the .env file in the current working directory into your environment (accessible with (uiop:getenv)). If there is no file nothing will be loaded into your environment.

Usage

(cl-env:init) ;; load .env for the same directory as current directory.

or

(cl-env:init #p"~/Projects/your-cool-project/.env") ;; load .env from a specific directory.

or

(cl-env:init (merge-pathnames (truename ".") ".env")) ;; load .dev.env from current directory.

Runnings tests

  1. Clone this repo

  2. Run make test


2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 cl-env

Easily parse .env files. That’s it!

Author

Evan M Jones (https://evanjon.es/) <me@evanjon.es>

License

MIT

Source

cl-env.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.1 cl-env/cl-env.asd

Source

cl-env.asd.

Parent Component

cl-env (system).

ASDF Systems

cl-env.


3.1.2 cl-env/package.lisp

Source

cl-env.asd.

Parent Component

cl-env (system).

Packages

cl-env.


Previous: , Up: Lisp   [Contents][Index]

3.1.3 cl-env/cl-env.lisp

Dependency

package.lisp (file).

Source

cl-env.asd.

Parent Component

cl-env (system).

Public Interface
Internals

split (function).


4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 cl-env

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

split (function).


5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Public Interface


5.1.1 Ordinary functions

Function: getenv (key &key default)

Small wrapper around (uiop:getenv). :default always you to specify a default variable. If the current environment does not have a value.

Package

cl-env.

Source

cl-env.lisp.

Function: init (&optional filepath)

Reads the environment file, splits it up, and injects into current environment.

Package

cl-env.

Source

cl-env.lisp.


5.2 Internals


Previous: , Up: Internals   [Contents][Index]

5.2.1 Ordinary functions

Function: split (somestring &key delim)

Simple function, similar to String.prototype.split in JavaScript

Package

cl-env.

Source

cl-env.lisp.


Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts


Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables