I often write HTTP program with using HTTPoison in Elixir.
Of course if I use mix for creating new project and modify mix.exs for dependency for HTTPoison, mix deps.get
can resolve dependencies.
However, sometimes I want to try short scripts (.exs) or iex for simple experiment which require external modules without creating a new project.
Are there any methods to solve this requirement like 'libraries search path' in Elixir?
The Code
module has functions to implement all the things you need. However, it only works with existing files on the machine and you'll need to do pretty much everything "manually".
Code.append_path
Code.ensure_loaded
should accomplish most of what you want.
Another approach is to use iex -S mix
in an existing project with
the dependencies and then load the .exs file.
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