1.0.6 • Published 6 years ago

gulp-notifier v1.0.6

Weekly downloads
3,210
License
MIT
Repository
github
Last release
6 years ago

Gulp Notifier

Gulp success and error notifications.

Installation

npm i gulp-notifier --save
const notifier = require('gulp-notifier');

Usage

gulp.task('someTask', () => {
  return gulp.src([...])
  .pipe(plumber({errorHandler: notifier.error }))
  .pipe(concat('ccombined.js))
  .pipe(gulp.dest('/some/location/'))
  .pipe(notifier.success())
});

You can pass in a string or object of options. A string will be defined as the message or message shorthand.

notifier.success('js', { project : 'My Project'})

Options

OptionTypeDefaultDetails
projectString-Project name. Will appear as a subheading
exclusionsString-Files that match any part of this string will be excluded from any notification
extraArray or String-Manually add extra files to log out, regardless of whether they actually part of the stream
prefixString-String to add before the notification message
suffixString-String to add after the notification message
popupsBooltruePrevent popups from showing. Console logs will still be rendered. Remote servers won't need popups and may even cause errors.
delayBoolfalseIf set to true, all console messages will be logged into a array. All logs can then be triggers using the logs function
successStringIcon to use on success messages. Can be relative to the project folder or an absolute URL
errorStringIcon to use on error messages. Can be relative to the project folder or an absolute URL
messagesStringFiles compiled successfullyThe message you want to display. This can be a shorthand name that references an object key defined in the defaults function (see below)

Defaults

You can define all your own default options outside of the stream.

notifier.defaults({
  project : 'My Project,
  success : 'images/icon.png',
  exclusions:'.map',
  messages  : {
    js      : 'Javascripts are all done!',
    sass    : 'Looking gooooood!'
  }
});

Logs

The logs function will log out all previously saved console messages. Designed to be used in conjunction with Gulps on end feature.

gulp.task('someTask', () => {
  return gulp.src([...])
  .pipe(notifier.success())
  .on('end', () => { notifier.logs() })
});
1.0.6

6 years ago

1.0.5

6 years ago

1.0.4-2

6 years ago

1.0.4-1

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago