Search⌘ K
AI Features

Step 2: Use Libraries

Discover how to effectively use Elixir's built-in and Erlang libraries along with external packages from Hex.pm. Learn to manage project dependencies using Mix, add HTTP client libraries, and compile them to enhance your Elixir applications with practical examples and commands.

Elixir comes with a bunch of libraries preinstalled. Some are written in Elixir, and others in Erlang.

The first port of call is the Elixir documentation. Often, we’ll find a built-in library that does what we want.

Next, we see if any standard Erlang libraries do what we need. This isn’t a simple task. We visit http://erlang.org/doc/ and look in the left sidebar for “Application Groups.” Here, libraries are sorted by top-level category.

If we find what we’re looking for in either of these places, we’re all set because all these libraries are already available to the application. But if the built-in libraries don’t contain what we need, we’ll have to add an external dependency.

Finding

...