Code Monkey home page Code Monkey logo

elm-live's Introduction

Travis – build status David – status of dependencies Code style: airbnb

elm-live

A flexible dev server for Elm
Live reload included!

 

Screencast

 

INSTALLATION

# Globally for a user:
npm install --global elm elm-live

# …or locally for a project:
npm install --save-dev elm elm-live

If you’d rather bring your own global elm-make, npm install --global elm-live will do.

Note that you need node 4.0+ to run the tool natively. But if you’re stuck on an older version, don’t worry! Rumour has it that you can transpile the code to ES5!

 

SYNOPSIS

elm-live [<OPTIONS>] [--] <ELM-MAKE ARGS>  
elm-live --help

 

DESCRIPTION

First, we spawn elm-make with the ELM-MAKE ARGS you’ve given.

When the build is ready, we start a static HTTP server in the current directory. We inject a live reload snippet into every HTML file we serve. Every time a static file has changed, we’ll reload your app in all browsers you’ve opened it with. (Mobile and IE included!)

We also watch all *.elm files in the current directory and its subdirectories. Whenever you change, add or remove one of them, we’ll rebuild your program and reload the page.

 

OPTIONS

--port=PORT

Set the port to start the server at. If the port is taken, we’ll use the next available one. PORT should be a valid port number. Default: 8000.

--open

We’ll open the app in your default browser as soon as the server is up.

--no-recover

When elm-make encounters a compile error, we keep elm-live running and give you time to fix your code. Pass --no-recover if you want the server to exit immediately whenever it encounters a compile error.

--help

You’re looking at it.

 

EXAMPLES

The simplest scenario:

$ elm-live Main.elm --open

Custom HTML file:

$ echo \
  '<!doctype html>
  <link rel="stylesheet" href="/style.css" />
  <script src="/elm.js"></script>
  ' > index.html
$ elm-live Main.elm --output=elm.js --open

 

CREDITS

Many thanks to Evan Czaplicki, the creator of Elm, for git.io/elm-make – the most brilliant language compiler the world has ever seen! Without elm-make, elm-live would be a car without an engine.

Many thanks to Matt DesLauriers for the wonderful git.io/budo-server. That’s what does the heavy lifting on the static server side.

 

LICENSE

MIT © Tomek Wiszniewski

elm-live's People

Watchers

Noon van der Silk avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.