Skip to content

Commit

Permalink
Updated readme and package.json for new release
Browse files Browse the repository at this point in the history
Filled out the readme.md file with usage instructions, updated
the repository locations and authors in the package, and changed
the default LiveReload API version to 1.6.
  • Loading branch information
napcs committed Jun 8, 2012
1 parent c219b8d commit 4ecd7ee
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 13 deletions.
31 changes: 24 additions & 7 deletions README.md
@@ -1,17 +1,23 @@
node-livereload
===============

An implementation of the LiveReload server in Node.js.
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.

Install the browser plugin and read more about the project at [mockko/livereload](https://github.com/mockko/livereload).
# Example Usage

# Example
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).

Then install the livereload module with `npm`:

$ npm install livereload

Then, simply create a server and fire it up.

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

Use with a connect server:
You can also use this with a Connect server:

connect = require('connect');
connect.createServer(
Expand All @@ -23,12 +29,23 @@ Use with a connect server:
server = livereload.createServer({exts: ['less']});
server.watch(__dirname + "/public");

# Installation
# Options

$ npm install livereload
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/`

# Limitations

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

# License

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

Released under the MIT license. See `LICENSE` for details.
2 changes: 1 addition & 1 deletion livereload.coffee
Expand Up @@ -2,7 +2,7 @@ fs = require 'fs'
path = require 'path'
ws = require 'websocket.io'

version = '1.5'
version = '1.6'
defaultPort = 35729

defaultExts = [
Expand Down
2 changes: 1 addition & 1 deletion livereload.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions package.json
@@ -1,18 +1,21 @@
{ "name": "livereload"
, "description": "LiveReload server"
, "version": "0.3.0"
, "author": "Joshua Peek"
, "contributors": [
{ "name": "Joshua Peek" }
, { "name": "Brian P. Hogan", "email": "brianhogan@napcs.com" }
]
, "licenses": [
{ "type": "MIT"
, "url": "https://github.com/josh/node-livereload/blob/master/LICENSE"
, "url": "https://github.com/napcs/node-livereload/blob/master/LICENSE"
}]
, "repository":
{ "type": "git"
, "url": "http://github.com/josh/node-livereload.git"
, "url": "http://github.com/napcs/node-livereload.git"
}
, "main": "./livereload.js"
, "dependencies": {
"websocket.io": ">= 0.1.0"
}
, "engines" : { "node" : ">=0.2.0" }
, "engines" : { "node" : ">=0.4.0" }
}

0 comments on commit 4ecd7ee

Please sign in to comment.