Livereload interface for hackers


A CLI for livereload.

npm install -g lr
  • reload static assets without refreshing
  • watch files and directories, triggering tasks on changes
  • make-like configurations with .lr.yml
  • control task execution styles with configurable delimiters (see mute)

From --help:

Usage: lr [options] [path]:[command] ...


  -h, --help         output usage information
  -V, --version      output the version number
  -p, --port <port>  listen on port
  -m, --mute <char>  character to suppress reloading
  -f, --file <path>  path to configuration file
  -v, --verbose      more detailed log messages
  -s, --silent       suppress all log messages

Watch the path and reload on changes. All watches are recursive.


$ lr            # this is the same as passing `.`
$ lr foo bar    # pass as many paths as you like
$ lr foo/*.js   # globs are resolved

If given a command, lr will execute it before reloading. This is particularly useful for builds.


$ lr baz:make   # when baz changes, make, then reload

Mute commands are prefixed by the mute delimiter, @, by default.

A mute command does not trigger a reload. This is handy for builds with multiple compile steps. For instance, you may want to compile your stylus files quietly, instead waiting for changes in build before reloading.


$ lr public/*/*.styl:'@make stylus' build  # compile CSS when necessary, but only reload for changes in build
  • tests
  • docs on config files