Search code examples
elixirelixir-mix

What is equivalent to npm install --save in elixir mix with hex


Is there an equivalent to npm install --save for quick adding hex module to mix.exs ?

I know pasting hex module references do mix.exs deps function like this:

defp deps do
    [
        {:asn, "~> 0.2.1"},
        {:mix_docker, "~> 0.3.0"}
    ]
  end

shouldn't be a big deal, but I've got accustomed to convention

npm install --save xyz 

and the module is downloaded and installed in packages.json configuration file. Very handy.


Solution

  • No, there is no such thing. You need to add dependencies manually to your mix.exs.