Comparing version 2.1.3 to 2.1.4
{ | ||
"name": "wtch", | ||
"version": "2.1.3", | ||
"version": "2.1.4", | ||
"description": "small livereload/watch command line utility", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,3 +5,3 @@ # wtch | ||
A small command-line app that watches for file changes and triggers a live-reload on file save (to be used with the LiveReload plugin). Watches the current working directory for `js,html,css` file changes. Ignores `.git`, `node_modules` and `bower_components` folders. | ||
A small command-line app that watches for file changes and triggers a live-reload on file save (to be used with the [LiveReload plugin](https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei?hl=en)). Watches the current working directory for `js,html,css` file changes. Ignores `.git`, `node_modules` and `bower_components` folders. | ||
@@ -21,3 +21,3 @@ ```sh | ||
See [examples](#examples) for using with browserify, watchify, and other tools. | ||
See [setup](#setup) for a basic how-to, and [tooling](#Tooling) for more advanced uses with browserify, watchify, etc. | ||
@@ -61,4 +61,28 @@ PRs/suggestions welcome. | ||
## Examples | ||
## Setup | ||
First, install the LiveReload plugin for your browser of choice (e.g. [Chrome](https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei?hl=en)). | ||
Now, install some tools globally. | ||
```sh | ||
npm install wtch http-server garnish -g | ||
``` | ||
Create a basic `index.html` file that references scripts and/or CSS files. | ||
Then, you can run your development server like so: | ||
```sh | ||
http-server | wtch | garnish | ||
``` | ||
Enable LiveReload by clicking the plugin so the center of it turns black. You may need to refresh the page first. | ||
![Click to enable](http://imgur.com/YdCgusY) | ||
Now when you save a JS/HTML/CSS file in the current directory, it will trigger a live-reload event on your `localhost:8080` tab. CSS files will be injected without a page refresh. | ||
## Tooling | ||
This can be used for live-reloading alongside [wzrd](https://github.com/maxogden/wzrd), [beefy](https://github.com/maxogden/beefy) and similar development servers. For example: | ||
@@ -76,8 +100,2 @@ | ||
Or, even for a simple site with no JS content. The following example uses [http-server](https://www.npmjs.com/package/http-server) and listens for HTML/CSS changes in the current directory. | ||
```sh | ||
http-server | wtch | garnish | ||
``` | ||
See [this package.json's](https://github.com/mattdesl/wtch/blob/master/package.json) script field for more detailed examples. | ||
@@ -84,0 +102,0 @@ |
8603
102