Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mhanberg/const

Constants for Elixir!
https://github.com/mhanberg/const

Last synced: about 1 month ago
JSON representation

Constants for Elixir!

Awesome Lists containing this project

README

        

# Const

Adds constants to Elixir!

```elixir
defmodule TopBlogs do
use Const

defk BEST_BLOG, "https://mitchellhanberg.com"

def the_best?() do
~k"BEST_BLOG"
end
end

defmodule TopBlogs.Blogs do
use Const

def list do
~k"BEST_BLOG"TopBlogs
end
end
```

## Installation

If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `const` to your list of dependencies in `mix.exs`:

```elixir
def deps do
[
{:const, "~> 0.1.0"}
]
end
```

Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at .