gulp-crash-sound
Play a WAV or MP3 when gulp crashes.
Errors in gulp tasks tend to crash it. You then spend a few minutes trying to figure out what's gone wrong only to find that gulp crashed and you didn't notice.
Use this plugin to play a sound when gulp crashes so you know you need to fix something.
This plugin can also be used with gulp-plumber.
Installation
$ npm install -g gulp-crash-sound
Examples
The following examples show you 3 ways to use gulp-crash-sound.
1. Just include and use defaults.
var gCrashSound = require('gulp-crash-sound');
gulp.task('build', function() {
gulp.src('/some/path');
});
2. Play a sound in your error handler.
var gCrashSound = require('gulp-crash-sound');
function yourOnErrorFunction(err) {
gCrashSound.play();
}
.on('error', yourOnErrorFunction)
3. Wrap gulp-plumber.
var gCrashSound = require('gulp-crash-sound');
.pipe(plumber({
errorHandler: gCrashSound.plumb(yourOnErrorFunction)
}))
Configuration
The default sound is a 'gulp' but you can use any WAV or MP3 (drm free).
var gCrashSound = require('gulp-crash-sound');
gCrashSound.config({
file: '/path/to/your/wav/or/mp3',
duration: 3
});
Requirements
Known Issues