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
I can recommend you this blog post.
There's more than a couple of libraries I want to use without a Mix project, like
Get their sources from Github, git checkout to the last release and compile them.
One compilation was over, create ~/.mix/beam/ and move the .beam files into this directory.
Thankfully, iex is just a shell script. If you happen to have a custom $PATH variable that points to ~/.local/bin, then copy iex to this directory and rename it to something like deviex. Then in your custom deviex, move to the last line and change it to…
exec elixir --no-halt --erl "-user Elixir.IEx.CLI" -pa "$HOME/.mix/beam" +iex "$@"
And now it will load the .beam files located at ~/.mix/beam at startup.
The reason why we use a different script for IEx is to avoid name conflicts with installed libs in the projects you'll work on with regular iex.