Comparing version 0.1.1 to 0.1.3
@@ -146,5 +146,11 @@ var fs = require('fs'); | ||
Server.prototype.listen = function listen(port, fn) { | ||
Server.prototype.listen = function listen(port, host, fn) { | ||
this.port = port; | ||
this.server.listen(port, fn); | ||
if (typeof host === 'function') { | ||
fn = host; | ||
host = undefined; | ||
} | ||
this.server.listen(port, host, fn); | ||
}; | ||
@@ -151,0 +157,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"description": "Tiny LiveReload server, background-friendly", | ||
"version": "0.1.1", | ||
"version": "0.1.3", | ||
"homepage": "https://github.com/mklabs/tiny-lr", | ||
@@ -29,8 +29,7 @@ "bugs": "https://github.com/mklabs/tiny-lr/issues", | ||
"dependencies": { | ||
"body-parser": "^1.2.0", | ||
"debug": "^0.8.1", | ||
"faye-websocket": "^0.7.2", | ||
"noptify": "^0.0.3", | ||
"parseurl": "^1.0.1", | ||
"qs": "^1.0.0" | ||
"body-parser": "~1.8.0", | ||
"debug": "~0.8.1", | ||
"faye-websocket": "~0.7.2", | ||
"parseurl": "~1.3.0", | ||
"qs": "~2.2.3" | ||
}, | ||
@@ -37,0 +36,0 @@ "devDependencies": { |
@@ -46,22 +46,5 @@ # tiny-lr [![Build Status](https://travis-ci.org/mklabs/tiny-lr.svg?branch=master)](https://travis-ci.org/mklabs/tiny-lr) | ||
This package exposes a `bin` you can decide to install globally, but it's not recommended. | ||
tiny-lr --help | ||
Usage: tiny-lr [options] | ||
Options: | ||
-h, --help - Show help usage | ||
-v, --version - Show package version | ||
-p, --port - Port to listen on (default: 35729) | ||
--pid - Path to the generated PID file (default: ./tiny-lr.pid) | ||
The best way to integrate the runner in your workflow is to add it as a `reload` | ||
step within your build tool. This build tool can then use the internal binary | ||
linked by npm in `node_modules/.bin/tiny-lr` to not rely on global installs (or | ||
use the server programmtically). | ||
step within your build tool. | ||
You can start the server using the binary provided, or use your own start script. | ||
```js | ||
@@ -142,53 +125,8 @@ var tinylr = require('tiny-lr'); | ||
See [`tinylr.mk`](./tinylr.mk) file. | ||
See [make-livereload](https://github.com/mklabs/make-livereload) repo. | ||
Include this file into your project Makefile to bring in the following targets: | ||
### Using gulp | ||
- start - Start the LiveReload server | ||
- stop - Stops the LiveReload server | ||
- livereload - alias to start | ||
- livereload-stop - aias to stop | ||
See [gulp-livereload](https://github.com/vohof/gulp-livereload) repo. | ||
Then define your "empty" targets, and the list of files you want to monitor. | ||
```make | ||
CSS_DIR = app/styles | ||
CSS_FILES = $(shell find $(CSS_DIR) -name '*.css') | ||
# include the livereload targets | ||
include node_modules/tiny-lr/tinylr.mk | ||
$(CSS_DIR): $(CSS_FILES) | ||
@echo CSS files changed: $? | ||
@touch $@ | ||
curl -X POST http://localhost:35729/changed -d '{ "files": "$?" }' | ||
reload-css: livereload $(CSS_DIR) | ||
.PHONY: reload-css | ||
``` | ||
The pattern is always the same: | ||
- define a target for your root directory that triggers a POST request | ||
- `touch` the directory to update its mtime | ||
- add reload target with `livereload` and the list of files to "watch" as prerequisites | ||
You can chain multiple "reload" targets in a single one: | ||
```make | ||
reload: reload-js reload-css reload-img reload-EVERYTHING | ||
``` | ||
Combine this with [visionmedia/watch](https://github.com/visionmedia/watch) and | ||
you have a livereload environment. | ||
watch make reload | ||
# add a -q flag to the watch command to suppress most of the annoying output | ||
watch -q reload | ||
The `-q` flag only outputs STDERR, you can in your Makefile redirect the | ||
output of your commands to `>&2` to see them in `watch -q` mode. | ||
## Tests | ||
@@ -363,11 +301,4 @@ | ||
- [@FGRibreau](https://github.com/FGRibreau) / [pid.js gist](https://gist.github.com/1846952)) for the background friendly bin wrapper | ||
--- | ||
- 2014-05-01 - v0.0.6 - #41 - Sync with lastest changes from tiny-lr fork / Cleanup code from tasks / examples. See https://github.com/gruntjs/grunt-contrib-watch for grunt integration. | ||
- 2013-01-21 - v0.0.5 - [PR #18](https://github.com/mklabs/tiny-lr/pull/18) / [PR #21](https://github.com/mklabs/tiny-lr/pull/21) - https support / expose reload flags through options | ||
- 2013-01-21 - v0.0.4 - middleware support | ||
- 2013-01-20 - v0.0.3 - serve livereload from repo (#4) | ||
- 2013-01-12 - v0.0.2 - tasks - support for grunt 0.3.x (#1) | ||
- 2013-01-05 - v0.0.1 - Initial release | ||
- [@FGRibreau](https://github.com/FGRibreau) / [pid.js | ||
gist](https://gist.github.com/1846952)) for the background friendly | ||
bin wrapper, used in [make-livereload](https://github.com/mklabs/make-livereload) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5
1693
68506
24
302
+ Addedbody-parser@1.8.4(transitive)
+ Addedbytes@1.0.0(transitive)
+ Addeddepd@0.4.5(transitive)
+ Addedee-first@1.0.5(transitive)
+ Addediconv-lite@0.4.4(transitive)
+ Addedmime-db@1.12.0(transitive)
+ Addedmime-types@2.0.14(transitive)
+ Addedon-finished@2.1.0(transitive)
+ Addedqs@2.2.42.2.5(transitive)
+ Addedraw-body@1.3.0(transitive)
+ Addedtype-is@1.5.7(transitive)
- Removednoptify@^0.0.3
- Removedabbrev@1.1.1(transitive)
- Removedbody-parser@1.20.3(transitive)
- Removedbytes@3.1.2(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removedcontent-type@1.0.5(transitive)
- Removeddebug@2.6.9(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddepd@2.0.0(transitive)
- Removeddestroy@1.2.0(transitive)
- Removedee-first@1.1.1(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhttp-errors@2.0.0(transitive)
- Removediconv-lite@0.4.24(transitive)
- Removedinherits@2.0.4(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedms@2.0.0(transitive)
- Removednopt@2.0.0(transitive)
- Removednoptify@0.0.3(transitive)
- Removedobject-inspect@1.13.2(transitive)
- Removedon-finished@2.4.1(transitive)
- Removedqs@1.2.26.13.0(transitive)
- Removedraw-body@2.5.2(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedsetprototypeof@1.2.0(transitive)
- Removedside-channel@1.0.6(transitive)
- Removedstatuses@2.0.1(transitive)
- Removedtoidentifier@1.0.1(transitive)
- Removedtype-is@1.6.18(transitive)
- Removedunpipe@1.0.0(transitive)
Updatedbody-parser@~1.8.0
Updateddebug@~0.8.1
Updatedfaye-websocket@~0.7.2
Updatedparseurl@~1.3.0
Updatedqs@~2.2.3