Is there any portable format for elixir code? Other than the obvious tar.
For example, if I wanted to provide one or more modules to a client or fellow developers on another team (without the use of github). How would I do that?
The answer in some other familiar languages are: Ruby - gem, Java - jar, Python - egg, ect.
Hex is a package manager for the BEAM ecosystem, any language that compiles to run on the BEAM VM, such as Elixir and Erlang, can be used to build Hex packages. Hex consists of the HTTP API, this website, the repository serving packages and indexes, HexDocs, the Mix build-tool integration, and other services.
Hex is package manager for the Erlang VM. This project currently provides tasks that integrate with Mix, Elixir's build tool. See hex.pm for installation instructions and other documentation.
It depends on what you want to provide.
I will discuss three options below, all available through our build tool called Mix.
Hex packages source files. If you want to provide code for other developers to use in their projects, Hex is the best option because it knows how to fetch and resolve dependencies too. Call mix local.hex
to install it and then mix local
to see all available Hex tasks;
Escript allows you to bundle your whole project (including dependencies) into an executable that can be invoked from the command line. You need to have Erlang installed for escripts to work, you don't need to have Elixir installed though. Note an Escript cannot be used as a dependency by other projects.
Archives are basically a tar of compiled artifacts that the Erlang runtime knows how to load. Archives do not include dependencies and, in Elixir, they are used only as plugins for the Mix build tool. For example, Hex above is installed as an archive inside Mix.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With