How do I load an Elixir library into iex without adding it to a project's mix.exs deps?

前端 未结 3 1540
礼貌的吻别
礼貌的吻别 2021-02-01 17:19

I want to tryout the Poison json module without creating a mix project.

How do I install it and make it available in iex via import?

I have been able to add it

3条回答
  •  -上瘾入骨i
    2021-02-01 17:47

    I don't know if there is an official way to do this.

    One way would be to clone the library project locally, compile it, and then add it to the library path like this by creating a ~/.iex.exs script:

    IO.puts "Adding poison to path from ~/.iex.exs"
    true = Code.prepend_path("#{path_to_project}"/poison/_build/dev/lib/poison/ebin")
    

提交回复
热议问题