gulp-browser-notification

1.0.0 • Public • Published

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

/gulp-browser-notification/

    Package Sidebar

    Install

    npm i gulp-browser-notification

    Weekly Downloads

    1

    Version

    1.0.0

    License

    ISC

    Last publish

    Collaborators

    • juanfran