Step 2: Use Libraries

Learn how to add external libraries in Elixir.

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 an external library

Ruby has RubyGems, Python has pip, Node.js has npm and Elixir has the Hex package manager.

Visit ...