Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

elm : install elm format extension

I have installed elm-format package (using amp install elm-format) and I want to run it from the command line , example elm-format mypage.elm

In order to run it from the command line it should be available in one of the environment path let's say usr/local/bin while the elm-format directory is installed in the following path Users/myuser/.atom/packages and none is available in env path

what should I move to the PATH (usr/local/bin) , is the whole folder or an executable file

note : when i run ls Users/myuser/.atom/packages/elm-format i get the followings :

CHANGELOG.md README.md keymaps menus src LICENSE.md example lib package.json

like image 387
khaled omar Avatar asked Oct 20 '25 04:10

khaled omar


2 Answers

I will answer my question since I have solved it.

first you have to install the elm-format binary file using your browser form the following URL

after installing the binary file extract it add the path to the environment path for windows user add elm-format.exe or mac user add elm-format

since I am a mac user I used the below command to add it : mv ~/Download/elm-format /usr/local/bin/elm-format after installing the binary now we need to install elm-format extention for the appropriate editor since I am using atom editor I have used the following command apm install elm -format

now we can used elm-format command line to format the elm page

command line : elm-format pagename.elm

like image 82
khaled omar Avatar answered Oct 22 '25 16:10

khaled omar


According to npm website You could install elm-format by npm install -g elm-format.

like image 42
kkpoon Avatar answered Oct 22 '25 16:10

kkpoon