# better-livereload

> Better LiveReload server

Latest version **0.3.1** (published 2013-07-17) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install better-livereload
pnpm add better-livereload
yarn add better-livereload
bun add better-livereload
```

Provides the command `livereload`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2013-07-17 |
| First published | 2013-07-17 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.4.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | leftium |
| Keywords | livereload, server |

## Links

- npm: https://www.npmjs.com/package/better-livereload
- Repository: https://github.com/Leftium/node-livereload
- Issues: https://github.com/Leftium/node-livereload/issues
- npm.io page: https://npm.io/package/better-livereload

## Dependencies (2)

- [opts](https://npm.io/package/opts.md) >= 1.2.0
- [websocket.io](https://npm.io/package/websocket.io.md) >= 0.1.0

## Recent versions

- 0.3.1 (latest) — 2013-07-17

## README

better-livereload
======================

A drop-in replacement for
[node-livereload](https://npmjs.org/package/node-live-reload).
The purpose of this fork is two-fold:

 1. To make the most [recent version](https://npmjs.org/package/better-livereload) accessible from npm
 2. To add some performance enhancements

*Original README starts below (slightly edited and updated)...*
<hr />

An implementation of the LiveReload server in Node.js. It's an alternative to the graphical [http://livereload.com/](http://livereload.com/) application, which monitors files for changes and reloads your web browser.

# Example Usage

First, install the LiveReload browser plugins by visiting [http://help.livereload.com/kb/general-use/browser-extensions](http://help.livereload.com/kb/general-use/browser-extensions).

To use livereload from the command line:

    $ npm install -g better-livereload
    $ livereload [path]


Or to use the api within a project:

    $ npm install better-livereload

Then, simply create a server and fire it up.

    livereload = require('better-livereload');
    server = livereload.createServer();
    server.watch(__dirname + "/public");

You can also use this with a Connect server:

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

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

# Options

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/`

# License

Copyright John-Kim Murphy <br>
Original copyright (c) 2010-2012 Joshua Peek and Brian P. Hogan.

Released under the MIT license. See `LICENSE` for details.

---
_Source: https://npm.io/package/better-livereload · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
