this is a version of livereload more recently updated.
Last updated 8 years ago by sebv .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install livereload2 
SYNC missed versions from official npm registry.


An implementation of the LiveReload server in Node.js. It's an alternative to the graphical application, which monitors files for changes and reloads your web browser.

This is an alternative version of node-livereload, will remove it when the origin package is updated.

Example Usage

First, install the LiveReload browser plugins by visiting

To use livereload from the command line:

$ npm install -g livereload2
$ livereload [path]

For options: $ livereload --help

Or to use the api within a project:

$ npm install livereload

Then, simply create a server and fire it up.

livereload = require('livereload');
server = livereload.createServer(); + "/public");

You can also use this with a Connect server:

connect = require('connect');
  connect.compiler({ src: __dirname + "/public", enable: ['less'] }),
  connect.staticProvider(__dirname + "/public")

livereload = require('livereload');
server = livereload.createServer({exts: ['less']}); + "/public");


The createServer() method supports a few basic options, passed as a JavaScript object:

  • port is the listening port. It defaults to 35729 which is what the LiveReload extensions use currently.
  • exts is an array of extensions you want to observe. The default extensions are html, css, js, png, gif, jpg, php, php5, py, rb, and erb
  • applyJSLive tells LiveReload to reload JavaScript files in the background instead of reloading the page. The default for this is false.
  • applyCSSLive tells LiveReload to reload CSS files in the background instead of refreshing the page. The default for this is true.
  • exclusions lets you specify files to ignore. By default, this includes .git/, .svn/, and .hg/
  • alias lets you specify file extensions to be aliased. By default, this maps .styl to .css, by which, changing .styl file never fires full page reload.
  • delay delay in ms before refresh (default: 50)

Trigger refresh programmatically

The server is listening for post request on "/reload".

request = require('request');'http://localhost:35729/reload');


Right now this is extremely simple. It relies on polling so there's a delay in refreshing the browser. It could be faster.


Copyright (c) 2010-2012 Joshua Peek and Brian P. Hogan.

Released under the MIT license. See LICENSE for details.

Current Tags

  • 1.0.1                                ...           latest (8 years ago)

2 Versions

  • 1.0.1                                ...           8 years ago
  • 1.0.0                                ...           8 years ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 4
Dependencies (5)
Dev Dependencies (4)
Dependents (2)

Copyright 2014 - 2017 © |