Configuration library for Elixir
Elixir
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
README.md
mix.exs
mix.lock
package.head.exs

README.md

ExConfig

A simplistic configuration library for Elixir.

It allows you to define configurations as modules:

defmodule MyConfig do
  use ExConfig.Object
  defproperty http_port
  defproperty https_port, default: 8081
end

And then use them to define actual configurations:

MyConfig.config do
   config.http_port 8080
end

The value returned by the above code will be a MyConfig record with http_port and https_port configured.

ExConfig can be used to read config files as well:

config = MyConfig.file! "config.exs"