Liking cljdoc? Tell your friends :D

lambdaisland.dotenv

Parsing of dotenv files

Parsing of dotenv files
raw docstring

expand-varsclj/s

(expand-vars s vars)
source

parse-dotenvclj/s

(parse-dotenv contents)
(parse-dotenv contents {:keys [expand? vars] :or {vars {}}})

Parse the contents of a dotenv file, returns a map.

  • each line is interpreted as VAR_NAME=value
  • leading whitespace, a leading export keyword, and whitespace around the = sign is ignored
  • lines starting with # (and optionally whitespace) are ignored
  • Unix and Windows line endings are understood
  • Values can be unquoted, single-, or double-quoted
  • Quoted values can continue on consequtive lines
  • Unquoted or double-quoted values can contain interpolation using the ${VAR} syntax if {:expand? true} is set. Values can be interpolated from vars set earlier in the contents, passed in as the :vars options, or on Clojure (not ClojureScript) will be filled from the process environment (using System/getenv).
  • Certain backslash sequences are understood in unquoted or double-quoted values. \n newline, \t tab, \r carriage return, \f form feed, \b backspace, unicode character. A backslash followed by any other character will be replaced by said characters, including single and double quotes.
  • In single-quoted values only ' is understood, other escape sequences are treated literally
Parse the contents of a dotenv file, returns a map.

- each line is interpreted as VAR_NAME=value
- leading whitespace, a leading `export` keyword, and whitespace around the `=` sign is ignored
- lines starting with `#` (and optionally whitespace) are ignored
- Unix and Windows line endings are understood
- Values can be unquoted, single-, or double-quoted
- Quoted values can continue on consequtive lines
- Unquoted or double-quoted values can contain interpolation using the ${VAR}
  syntax if `{:expand? true}` is set. Values can be interpolated from vars set
  earlier in the contents, passed in as the `:vars` options, or on Clojure (not
  ClojureScript) will be filled from the process environment (using
  `System/getenv`).
- Certain backslash sequences are understood in unquoted or double-quoted
  values. \n newline, \t tab, \r carriage return, \f form feed, \b
  backspace, ￿ unicode character. A backslash followed by any other
  character will be replaced by said characters, including single and double
  quotes.
- In single-quoted values only \' is understood, other escape sequences are
  treated literally
sourceraw docstring

parse-hexclj/s

(parse-hex h)
source

split-at-predclj/s

(split-at-pred pred coll)

Partition a collection in two, such that in the first partition no element but the last satisfies predicate pred. Returns nil if no element satisfied pred.

Partition a collection in two, such that in the first partition no element but
the last satisfies predicate `pred`. Returns `nil` if no element satisfied
`pred`.
sourceraw docstring

unquote-charsclj/s

(unquote-chars s)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close