New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gulp-notify

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-notify - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

18

examples/gulpfile.js

@@ -6,2 +6,3 @@

var plumber = require('gulp-plumber');
var nn = require('node-notifier');

@@ -86,2 +87,18 @@ gulp.task("multiple", function () {

gulp.task("forceGrowl", function () {
var custom = notify.withReporter(function (options, callback) {
new nn.Growl().notify(options, callback);
});
gulp.src("../test/fixtures/*")
.pipe(through.obj(function (file, enc, callback) {
this.emit("error", new Error("Something happend: Error message!"));
callback();
}))
.on("error", custom.onError('Error: <%= error.message %>'))
.on("error", function (err) {
console.log("Error:", err);
})
});
gulp.task("customError", function () {

@@ -108,2 +125,1 @@

});

37

lib/extra_api.js

@@ -14,6 +14,26 @@ var through = require("through2");

var logError = module.exports.logError = function (options, isError) {
if (!logLevel) return;
if (logLevel === 1 && !isError) return;
color = isError ? "red" : "green";
if (!gutil.colors[color]) return;
fnLog(gutil.colors.cyan('gulp-notify') + ':',
'[' + gutil.colors.blue(options.title) + ']',
gutil.colors[color].call(gutil.colors, options.message)
);
};
// Expose onError behaviour
module.exports.onError = function (options) {
module.exports.onError = function (options, callback) {
var reporter;
options = options || {};
var templateOptions = options.templateOptions || {};
var callback = callback || function (err) {
err && logError({
title: "Error running notifier",
message: "Could not send message: " + err.message
}, true);
};

@@ -27,3 +47,3 @@ if (options.notifier) {

return function (error) {
report(reporter, error, options);
report(reporter, error, options, templateOptions, callback);
};

@@ -43,14 +63,1 @@ };

};
module.exports.logError = function (options, isError) {
if (!logLevel) return;
if (logLevel === 1 && !isError) return;
color = isError ? "red" : "green";
if (!gutil.colors[color]) return;
fnLog(gutil.colors.cyan('gulp-notify') + ':',
'[' + gutil.colors.blue(options.title) + ']',
gutil.colors[color].call(gutil.colors, options.message)
);
};

@@ -75,4 +75,4 @@ var template = require("lodash.template");

}
return options;
}
{
"name": "gulp-notify",
"version": "1.1.1",
"version": "1.2.0",
"description": "A plugin for Gulp to send messages to Mac Notification Center or Linux' notify-send",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc