Install
- Mac — installer
- Windows —
After installing through any of those routes, you will have the following command line tools:
- — play with Elm expressions
- — get a project going quickly
elm-make
— compile Elm code directly- — download packages
We will go over how they all work in more detail right after we get your editor set up!
Using Elm is way nicer when you have a code editor to help you out. There are Elm plugins for at least the following editors:
If you do not have an editor at all, is a great one to get started with!
You may also want to try out elm-format which makes your code pretty!
lets you play with simple Elm expressions.
We will be using elm-repl
in the upcoming “Core Language” section, and you can read more about how it works here.
helps you build Elm projects without messing with the command-line too much. You just run it at the root of your project, like this:
This starts a server at http://localhost:8000
. You can navigate to any Elm file and see what it looks like. Try to check out examples/01-button.elm
.
Notable flags:
--port
lets you pick something besides port 8000. So you can sayelm-reactor --port=8123
to get things to run athttp://localhost:8123
.--address
lets you replacelocalhost
with some other address. For
example, you may want to useelm-reactor --address=0.0.0.0
if you want to
try out an Elm program on a mobile device through your local network.
Say you want to compile Main.elm
to an HTML file named main.html
. You would run this command:
Notable flags:
--warn
prints warnings to improve code quality
downloads and publishes packages from our package catalog. As community members solve problems , they share their code in the package catalog for anyone to use!
Say you want to use elm-lang/http
and to make HTTP requests to a server and turn the resulting JSON into Elm values. You would say:
This will add the dependencies to your elm-package.json
file that describes your project. (Or create it if you do not have one yet!) More information about all this here!
Notable commands:
install
: install the dependencies inelm-package.json
publish
: publish your library to the Elm Package Catalogdiff
: get the difference between two APIs