joetjen.net
EN DE
← All libraries
Elixir

cooper

Loads CASC config files — hierarchical, with imports, variables, interpolation, environment reads and loops — into native Elixir terms.

Intention

Config libraries either parse a fixed format or hand you a bespoke DSL with no formal grammar behind it. CASC has a real specification, and Cooper implements it through Ichor rather than hand-rolled string parsing, so the interpreter tracks the grammar and not the other way around. It is the reference: the Node.js and PHP ports read the same files to the same result, and one conformance suite holds every implementation to the same cases.

Example
#@version = 1.0

@region = "eu-west"

database {
  *password = ${DB_PASSWORD}
  host = "db.@{region}.internal"
  timeout = 500ms
}
Install
{:cooper, "~> 0.7.0"}
ElixirConfigurationCASC