Zach Peters

"Hex.pm Reference"

The content below is converted from an old website, it may not be rendered perfectly

title: “Hex.pm Reference” date: 2018-11-04T13:44:36-06:00 draft: false tags:

  • reference

https://hex.pm/docs/usage

{{<highlight elixir>}} defmodule MyProject.MixProject do use Mix.Project

def project() do

[
  app: :my_project,
  version: "0.0.1",
  elixir: "~> 1.0",
  deps: deps(),
]

end

def application() do

[]

end

defp deps() do

[
  {:ecto, "~> 2.0"},
  {:postgrex, "~> 0.8.1"},
  {:cowboy, github: "ninenines/cowboy"},
]

end end {{</highlight>}}

Options

  • :hex The name of the package. Defaults to the dependency application name.
  • :repo The repository to fetch the package from, the repository needs to be configured with the mix hex.repo task. Defaults to the global “hexpm” repository.
  • :organization The organization repository to fetch the package from, the organization needs to be configured with the mix hex.organization task.