How to use gulp-notify - 10 common examples

To help you get started, we’ve selected a few gulp-notify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github laravel / elixir / src / Notification.js View on Github external
error(e, message) {
        notify.onError({
            title: this.title,
            message: message + ': <%= error.message %>',
            icon: __dirname + '/../icons/fail.png',
            onLast: true
        })(e);

        // We'll spit out the error, just in
        // case it is useful for the user.
        console.log(e);
    }
github alienfast / gulp-pipeline / dist / gulp-pipeline.es.js View on Github external
notifyError(error, watching = false) {
    let lineNumber = (error.lineNumber) ? `Line ${error.lineNumber} -- ` : ''
    let taskName = error.task || this.taskName()

    notify({
      title: `Task [${taskName}] Failed in [${error.plugin}]`,
      message: `${lineNumber}See console.`,
      sound: 'Sosumi' // See: https://github.com/mikaelbr/node-notifier#all-notification-options-with-their-defaults
    }).write(error)

    let tag = Util.colors.black.bgRed
    let report = `

${tag('    Task:')} [${Util.colors.cyan(taskName)}]
${tag('  Plugin:')} [${error.plugin}]
${tag('   Error:')}
${error.message}`

    if (error.lineNumber) {
      report += `${tag('    Line:')} ${error.lineNumber}\n`
    }
github dsebastien / midnightLightV2 / gulp / utils.js View on Github external
let reportError = function(error) {

	let lineNumber = error.lineNumber ? 'LINE ' + error.lineNumber + ' -- ' : '';

	notify({
		title: 'Task Failed [' + error.plugin + ']',
		message: lineNumber + 'See console.',
		sound: true

		// the version below probably works on OSX
		//sound: 'Sosumi' // See: https://github.com/mikaelbr/node-notifier#all-notification-options-with-their-defaults
	}).write(error);

	//gutil.beep(); // Beep 'sosumi' again

	// Inspect the error object
	//gutil.log(error);

	// Easy error reporting
	//console.log(error.toString());
github weareyou / generator-patternlab-starterkit / app / templates / _gulpfile.js View on Github external
var handleError = function (error) {
  var lineNumber = (error.lineNumber) ? 'LINE ' + error.lineNumber + ' -- ' : '';

  notify({
    title: 'Task Failed [' + error.plugin + ']',
    message: lineNumber + 'See console.'
  }, notify.logLevel(0)).write(error);

  // Inspect the error object
  //console.log(error);

  // Easy error reporting
  //console.log(error.toString());

  // Pretty error reporting
  var report = '';

  report += chalk.white.bgRed('TASK:') + ' [' + error.plugin + ']\n';
  report += chalk.white.bgRed('ERROR:') + ' ' + error.message + '\n';
  if (error.lineNumber) { report += chalk.red('LINE:') + ' ' + error.lineNumber + '\n'; }
  if (error.fileName)   { report += chalk.red('FILE:') + ' ' + error.fileName + '\n'; }

  console.error(report);
github cmackay / hybrid-boilerplate / config / gulp / index.js View on Github external

'use strict';

/**
 * Module dependencies
 */
var fs   = require('fs'),
  path   = require('path'),
  notify = require('gulp-notify');

// don't need duplicated error messages
notify.logLevel(0);

// load the tasks
fs.readdirSync('./config/gulp/tasks/')
  .filter(function (name) {
    return /(\.(js)$)/i.test(path.extname(name));
  })
  .forEach(function (task) {
    require(path.resolve('./config/gulp/tasks/', task));
  });
github ghiscoding / aurelia-slickgrid / client-cli / aurelia_project / tasks / process-markup.js View on Github external
export default function processMarkup() {
  return gulp.src(project.markupProcessor.source)
    .pipe(plumber({errorHandler: notify.onError('Error: <%= error.message %>')}))
    .pipe(changedInPlace({firstPass:true}))
    .pipe(htmlmin({
        removeComments: true,
        collapseWhitespace: true,
        minifyCSS: true,
        minifyJS: true,
        ignoreCustomFragments: [/\${.*?}/g] // ignore interpolation expressions
    }))
    .pipe(build.bundle());
}
github jaredpalmer / after.js / packages / after / gulpfile.js View on Github external
gulp.task('watch-client', function() {
  return gulp.watch('client/**/*.js', ['compile-client', 'build-dev-client']);
});

gulp.task('clean', () => {
  return del(['dist']);
});

gulp.task('default', ['compile', 'build', 'watch']);

gulp.task('release', ['compile', 'build-release']);

// avoid logging to the console
// that we created a notification
notify_.logLevel(0);

// notification helper
function notify(msg) {
  return notify_({
    title: 'AFTR',
    message: msg,
    icon: false,
    onLast: true,
  });
}
github zeit / next.js / gulpfile.js View on Github external
gulp.task('stop-chromedriver', () => {
  try {
    if (isWindows) {
      childProcess.execSync('taskkill /im chromedriver* /t /f', { stdio: 'ignore' })
    } else {
      childProcess.execSync('pkill chromedriver', { stdio: 'ignore' })
    }
  } catch(ex) {
    // Do nothing
  }
})

// avoid logging to the console
// that we created a notification
notify_.logLevel(0)

// notification helper
function notify (msg) {
  return notify_({
    title: '▲ Next',
    message: msg,
    icon: false,
    onLast: true
  })
}
github yannickcr / gulp-notify-growl / lib / gulp-notify-growl.js View on Github external
if (typeof appName === 'undefined') {
    appName = 'Gulp';
  }

  applicationOptions = util._extend({
    icon: fs.readFileSync(__dirname + '/gulp.png')
  }, applicationOptions || {});

  var app = new growler.GrowlApplication(appName, applicationOptions);

  app.setNotifications({
    Gulp: {}
  });

  var reporter = notify.withReporter(function(notificationOptions, callback) {

    app.register(function(success, err) {
      if (!success) {
        return callback(err);
      }

      // Rename 'message' property to 'text'
      notificationOptions.text = notificationOptions.message;
      delete notificationOptions.message;

      app.sendNotification('Gulp', notificationOptions, function(success, err) {
        return callback(err, success);
      });

    });
github kitze / gtb / tasks / compile / compile-sass.js View on Github external
var showError = function (err) {
      var file = err.file.replace(dir(config.dirs.css), '');
      notifier.notify({
        'title': 'SASS error',
        'message': err.message + " at " + file
      });
      con.custom(chalk.red.bold('SASS error: ') + err.message);
      /* Don't show the full size of the path in the error */
      con.custom(chalk.red.bold('File: ') + file);
      con.custom(chalk.red.bold('Position: ') + 'Line:' + err.line + ' Column:' + err.column);
    };

gulp-notify

gulp plugin to send messages based on Vinyl Files or Errors to Mac OS X, Linux or Windows using the node-notifier module. Fallbacks to Growl or simply logging

MIT
Latest version published 3 years ago

Package Health Score

47 / 100
Full package analysis