How to quickly install elm packages?

When setting up new projects I often find myself in situation I want to install bunch of initial packages from package.elm-lang.org I know I’ll need. I search for the package, click the name and copy the “username/packagename” portion of the URL, type "elm package install --yes " in terminal and press Ctrl+V.

What’s your way of doing that? Granted, you don’t need to install packages very often, and it’s just a few keystrokes, but it still annoys me a bit every time I have to do this :grinning:

It would find it useful if there was a button next to each package name, which when clicked would copy the command to install this package (“elm package install username/packagename”) to your OS clipboard. What do you think?

2 Likes

Sounds like a good idea for a Chrome plugin! Meanwhile, there’s at least https://github.com/eeue56/elm-bash-completion

1 Like

Sounds like a good feature for package.elm-lang to have, but personally I have just memorized the author/names for all the packages I usually use.

Sounds like a job for a boilerplate repository to me.

The Elm plugin for VSCode allows you to install packages from the command pallet. Bring it up (with Cmd+Shift+P on Mac) and search for and choose “Elm: Install packages/dependencies”. Then it will present you with the package index and you can search/install right from there. Maybe something similar is available in other editor plugins?

1 Like

You could have an elm-package.json that you put in new projects. Copy it in, and elm-make will verify it and install everything in there. I feel like something fancier is overkill. Now you have to learn a fancy thing with tons of settings.

There are issues on the package website about making it easier to copy out the install command. Seems like a fine idea. Trying to get website stuff in the hands of another core team member, but we’ll add something like this eventually!

9 Likes

It is a nice feature to have in the web packages site (most packages web sites have some kind of copy-to-clipboard thing).

For starting projects however I usually just elm-package install --yes for simple ones. If I know it will be an SPA, I usually do what @evancz suggested above, just copy the elm-package.json from some other project, usually from elm-spa-example as that project has most libraries I will use for the beginning of the project.

You could also take a look at elm-new. Maybe it fits your new project needs.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.