gulp-notify
Advanced tools
Comparing version 1.2.4 to 1.2.5
{ | ||
"name": "gulp-notify", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"description": "A plugin for Gulp to send notification messages (Mac, Linux and Windows", | ||
@@ -31,3 +31,3 @@ "keywords": [ | ||
"lodash.template": "~2.4.1", | ||
"node-notifier": "^2.0.3", | ||
"node-notifier": "^2.0.4", | ||
"node.extend": "^1.0.9" | ||
@@ -34,0 +34,0 @@ }, |
@@ -10,3 +10,3 @@ # gulp-notify [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url] | ||
| Node Version | >= 0.8 | | ||
| Package Version | 1.2.1 | | ||
| Package Version | 1.2.4 | | ||
@@ -54,2 +54,12 @@ **Note: Without overriding the notifier, Mac OS X >= 10.8 or as of v0.3.2, Linux with `notify-send` installed is required for this to run.** | ||
You can use [notify.onError()](#notifyonerror) as the errorHandler for gulp-plumber like this: | ||
```javascript | ||
gulp.src("../test/fixtures/*") | ||
.pipe(plumber({errorHandler: notify.onError("Error: <%= error.message %>")})) | ||
.pipe(through(function () { | ||
this.emit("error", new Error("Something happend: Error message!")) | ||
})); | ||
``` | ||
## API | ||
@@ -64,3 +74,3 @@ | ||
### notify(Function) | ||
Type: `function(VinylFile)` | ||
Type: `function(VinylFile)` | ||
@@ -82,3 +92,3 @@ The result of the function is used as message. | ||
#### options.onLast | ||
Type: `Boolean` | ||
Type: `Boolean` | ||
Default: `false` | ||
@@ -92,3 +102,3 @@ | ||
#### options.message | ||
Type: `String` | ||
Type: `String` | ||
Default: File path in stream | ||
@@ -102,3 +112,3 @@ | ||
##### as function | ||
Type: `Function(vinylFile)` | ||
Type: `Function(vinylFile)` | ||
@@ -108,3 +118,3 @@ See `notify(Function)`. | ||
#### options.title | ||
Type: `String` | ||
Type: `String` | ||
Default: "Gulp Notification" | ||
@@ -118,3 +128,3 @@ | ||
##### as function | ||
Type: `Function(vinylFile)` | ||
Type: `Function(vinylFile)` | ||
@@ -124,3 +134,3 @@ See `notify(Function)`. | ||
#### options.templateOptions | ||
Type: `Object` | ||
Type: `Object` | ||
Default: {} | ||
@@ -143,3 +153,3 @@ | ||
#### options.notifier | ||
Type: `Function(options, callback)` | ||
Type: `Function(options, callback)` | ||
Default: node-notifier module | ||
@@ -232,6 +242,6 @@ | ||
The `onError()` end point does not support `lodash.template`. | ||
The `onError()` end point does support `lodash.template`. | ||
### notify.logLevel(level) | ||
Type: `Integer` | ||
Type: `Integer` | ||
Default: `2` | ||
@@ -289,2 +299,32 @@ | ||
### As jshint reporter | ||
`gulp-notify` can easily be used as jshint reporter. | ||
As jshint exposes the result on the vinyl file we can | ||
use them in a function like so: | ||
```javascript | ||
gulp.task('lint', function() { | ||
gulp.src('/src/**/*.js') | ||
.pipe(jshint()) | ||
// Use gulp-notify as jshint reporter | ||
.pipe(notify(function (file) { | ||
if (file.jshint.success) { | ||
// Don't show something if success | ||
return false; | ||
} | ||
var errors = file.jshint.results.map(function (data) { | ||
if (data.error) { | ||
return "(" + data.error.line + ':' + data.error.character + ') ' + data.error.reason; | ||
} | ||
}).join("\n"); | ||
return file.relative + " (" + file.jshint.results.length + " errors)\n" + errors; | ||
})); | ||
}); | ||
``` | ||
If you use a function for message in `gulp-notify`, the message won't be shown. | ||
This is true for both direct use of function and `{ message: function () {}}`. | ||
## Changelog | ||
@@ -291,0 +331,0 @@ |
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
41320
19
872
356
Updatednode-notifier@^2.0.4