gulp-browser-notification
v1.0.0
Published
> Show notifications in your browser
Downloads
1
Maintainers
Readme
#gulp-browser-notification
Show notifications in your browser
Install
npm install --save-dev gulp-browser-notification
Usage
Import
var browserNotification = require('gulp-browser-notification');
Addinig connect/express middleware
app.use(browserNotification.connect());
Adding to tasks
gulp.task('example-taks', function() {
return gulp.src('/html/*.html')
.pipe(browserNotification('the html has changed!'));
});
you can also call a function
gulp.task('example-taks', function() {
return gulp.src('/html/*.html')
.pipe(browserNotification.notify(function(file) {
return {
title: 'the html has changed! ' + file.path
}
}))
});
options
changing port
- Type:
Integer
- Default: 35728
app.use(browserNotification.connect({
port: 35728
}));
adding options to the notification
.pipe(browserNotification.notify("Hi!"), {
body: "notification body"
})
with function
.pipe(browserNotification.notify(function(file) {
return {
title: file.path,
options: {
body: "notification body"
}
}
}))