XUtils

Elm JSON

Install, upgrade and uninstall Elm dependencies


Example: Installing the latest available version of a package

elm-json install elm/http

Adds the latest version of elm/http to your dependencies.

For packages, it will use the latest possible version as the lowerbound, and the next major as the exclusive upper bound. This mirrors the behaviour of elm install.

For applications, this will pick the latest available version, adding all indirect dependencies as well.

Example: Installing the latest available 2.x.x version of a package

elm-json install elm/http@2

Adds the latest version of elm/http with 2 as its major version number to your dependencies.

Example: Installing as a test-dependency

elm-json install --test elm/http@2.0.0

Adds version 2.0.0 of elm/http to your test-dependencies.

For packages, the provided version is used as the lower bound, with the next major being used as the exclusive upper bound.

For applications, this will install exactly the specified version.

Example: Installing multiple dependencies to a specified elm.json file

elm-json install elm/http elm/json -- elm/elm.json

Add the latest possible versions of elm/http and elm/json to ./elm/elm.json.

Example: Uninstalling a package

elm-json uninstall elm/html

Removes the elm/html package from your dependencies.

Example: Safely updating all dependencies

elm-json upgrade

This command will check if any updates can safely be applied. In practice this means that for your direct dependencies and direct test-dependencies, we’ll look for newer versions with the same major version number. Your indirect dependencies and indirect test-dependencies may be modified in more ways, depending on the constraints set by your direct dependencies.

Example: Major version upgrades for your dependencies

elm-json upgrade --unsafe

If major version changes are available, this will attempt to apply them. Note that this may still not update all dependencies to their latest release, if you have another dependency preventing to do so.

If you want to upgrade a specific package to a specific version, try running elm-json install author/project@version, which will tell you what package(s) are preventing this from happening.


Articles

  • coming soon...