watchify-middleware
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -10,2 +10,6 @@ var createBundler = require('./lib/bundler') | ||
module.exports.getWatchifyVersion = function () { | ||
return require('watchify/package.json').version | ||
} | ||
function createEmitter (browserify, opt) { | ||
@@ -12,0 +16,0 @@ var bundler = createBundler(browserify, opt) |
{ | ||
"name": "watchify-middleware", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "a server for faster watchify development", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -80,11 +80,11 @@ # watchify-middleware | ||
#### `emitter.middleware` | ||
##### `emitter.middleware` | ||
The `middleware(req, res)` function for use in your server. | ||
#### `emitter.on('pending', fn)` | ||
##### `emitter.on('pending', fn)` | ||
Called when watchify begins its incremental rebuild. | ||
#### `emitter.on('update', fn)` | ||
##### `emitter.on('update', fn)` | ||
@@ -95,3 +95,3 @@ Called when bundling is finished, with parameter `(contents, rows)`. | ||
#### `emitter.on('log', fn)` | ||
##### `emitter.on('log', fn)` | ||
@@ -114,14 +114,18 @@ Provides timing and server request logging, passing an `(event)` parameter. | ||
#### `emitter.on('error', fn)` | ||
##### `emitter.on('error', fn)` | ||
If `errorHandler` was `fasle`, this will get triggered on bundle errors. If an error handler is being used, this will not get triggered. | ||
#### `emitter.on('bundle-error', fn)` | ||
##### `emitter.on('bundle-error', fn)` | ||
This will get triggered on bundle errors, regardless of whether `errorHandler` is being used. This can be used to respond to syntax errors, such as showing a stylized notification. | ||
#### `emitter.close()` | ||
##### `emitter.close()` | ||
Closes the `watchify` instance and stops file watching. | ||
#### `version = watchifyMiddleware.getWatchifyVersion()` | ||
Primarily useful for debugging, this will return the *actual* version number of the `watchify` module being used by `watchify-middleware`. | ||
## running the demo | ||
@@ -128,0 +132,0 @@ |
12361
201
149