gulp-error-notifier
Version:
Notify about errors from gulp plugins and streams
80 lines (59 loc) • 2.15 kB
Markdown
[![NPM version][npm-image]][npm-url]
Notify about errors from gulp plugins and streams via desktop notifications of [node-notifier].
```shell
npm install --save-dev gulp-error-notifier
```
```javascript
var gulp = require('gulp');
var errorNotifier = require('gulp-error-notifier');
var jade = require('gulp-jade');
gulp.src('./src/*.jade')
.pipe(errorNotifier())
.pipe(jade())
.pipe(gulp.dest('./dist'));
```
[] stream with [`notify`](
Logs `error` to console and displays `error` notification.
```javascript
var notify = require('gulp-error-notifier').notify;
notify(new Error('Something happened!'));
```
Notifies on `stream` `'error'` event and stops it from further executing.
To be used with [SASS] and [Browserify].
```javascript
var gulp = require('gulp');
var errorNotifier = require('gulp-error-notifier')
var sass = require('gulp-sass');
gulp.src('./src/*.scss')
.pipe(errorNotifier.handleError(sass()))
.pipe(gulp.dest('./dist'));
```
For detailed executable examples look at [`examples/gulpfile.babel.js`][example-gulpfile].
```shell
cd examples
npm install
gulp --tasks
gulp example
```
All contributions are welcome. Make a pull request or open an [issue].
[](https://en.wikipedia.org/wiki/MIT_License)

[]: https://npmjs.org/package/gulp-error-notifier
[]: https://img.shields.io/npm/v/gulp-error-notifier.svg
[]: https://github.com/mikaelbr/node-notifier
[]: https://github.com/floatdrop/gulp-plumber
[]: https://github.com/floatdrop/gulp-plumber#optionserrorhandler
[]: https://github.com/dlmanning/gulp-sass
[]: http://browserify.org/
[]: https://github.com/feradjs/gulp-error-notifier/blob/master/examples/gulpfile.babel.js
[]: https://github.com/feradjs/gulp-error-notifier/issues/new