node package manager
Easy sharing. Manage teams and permissions with one click. Create a free org »

gulp-browser-notification

gulp-browser-notification

Show notifications in your browser

notification

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"
      }
    }
}))

All notification options