elm-tooling CLI
elm-tooling is a command line program that manages your Elm tools. elm-tooling init
creates elm-tooling.json
, and elm-tooling install
installs all tools specified in there in a fast and secure way. It’s a drop-in replacement for installing tools using npm
.
Why?
For why to install locally, see When should I use elm-tooling
to install tools? – it’s for the same reasons you’d use npm
.
So what’s wrong with the npm
based installers? It’s all about performance, user experience and security.
Let’s compare installing elm
, elm-format
and elm-json
using npm
and elm-tooling
:
Metric | npm | elm-tooling |
---|---|---|
Number of packages | 70 | 1 |
node_modules/ size |
45 MB | 120 KB |
Installation time | 9 s | 2 s |
Re-installation time | 9 s | 0.5 s |
Processing | Sequential | Parallel |
Download verification | None | SHA256 |
Working with Elm shouldn’t feel bloated. It should be snappy. It should be lightweight. It should be secure. And easy to use. elm-tooling
is trying to do all that.
More details: Why install Elm tools using elm-tooling
instead of npm
?
How does elm-tooling
work?
In elm-tooling.json
you can specify your tools:
{
"tools": {
"elm": "0.19.1",
"elm-format": "0.8.4"
}
}
elm-tooling install
downloads the tools you’ve specified to ~/.elm/
(the place where Elm stores downloaded Elm packages) if they don’t exist already:
~/.elm/elm-tooling
├── elm
│ └── 0.19.1
│ └── elm
└── elm-format
└── 0.8.4
└── elm-format
elm-tooling install
then creates links in your local ./node_modules/.bin/
folder (use npx
to run them):
./node_modules/.bin/elm -> ~/.elm/elm-tooling/elm/0.19.1/elm
./node_modules/.bin/elm-format -> ~/.elm/elm-tooling/elm-format/0.8.4/elm-format
More details: How does elm-tooling install
work?
Getting started
Assuming you already have a package.json
npm install --save-dev elm-tooling
npx elm-tooling init
npx elm-tooling install
npx elm --help
Add "postinstall": "elm-tooling install"
to your package.json to automatically run elm-tooling install
after npm install
.
Want more details? See Getting started on the website.
What’s next?
- Keep tweaking the docs
- Add elm-test-rs
- Fix any issues reported!
Other than that elm-tooling
feels complete!
Don’t forget to listen to the elm-radio episode about elm-tooling!