Huge News!Announcing our $40M Series B led by Abstract Ventures.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.0.0-beta to 1.1.0

10

lib/notify.js
var through = require("through2");
var report = require('./report');
var notifier = require("node-notifier");
var Notification = require("node-notifier");

@@ -8,2 +8,3 @@ "use strict";

module.exports = function (options) {
var reporter;

@@ -13,3 +14,8 @@ options = options || {};

var reporter = options.notifier || notifier.notify;
if (options.notifier) {
reporter = options.notifier;
} else {
var notifier = new Notification(options);
var reporter = notifier.notify.bind(notifier);
}
var lastFile = null;

@@ -16,0 +22,0 @@

44

lib/report.js

@@ -34,2 +34,6 @@ var template = require("lodash.template");

if (typeof options === "string") {
message = options;
}
if (typeof options === "object") {

@@ -47,33 +51,29 @@ if (typeof options.title === "function") {

}
} else {
options = {};
}
if (typeof options === "string") {
message = options;
}
if (object instanceof Error) {
var titleTemplate = template(title);
var messageTemplate = template(message);
return {
title: titleTemplate({
error: object,
options: templateOptions
}),
message: messageTemplate({
error: object,
options: templateOptions
})
};
}
return {
title: gutil.template(title, {
options.title = titleTemplate({
error: object,
options: templateOptions
});
options.message = messageTemplate({
error: object,
options: templateOptions
});
} else {
options.title = gutil.template(title, {
file: object,
options: templateOptions
}),
message: gutil.template(message, {
});
options.message = gutil.template(message, {
file: object,
options: templateOptions
})
};
});
}
return options;
}
{
"name": "gulp-notify",
"version": "1.0.0-beta",
"version": "1.1.0",
"description": "A plugin for Gulp to send messages to Mac Notification Center or Linux' notify-send",

@@ -28,6 +28,6 @@ "keywords": [

"dependencies": {
"node-notifier": "~1.2.1",
"through2": "~0.4.0",
"gulp-util": "~2.2.12",
"lodash.template": "~2.4.1"
"lodash.template": "~2.4.1",
"node-notifier": "^2.0.0-alpha"
},

@@ -49,2 +49,2 @@ "devDependencies": {

]
}
}

@@ -79,2 +79,33 @@ /*global describe, it*/

it('should call notifier with extra options untouched', function(done) {
var testString = "this is a test";
var testIcon = "face-cool";
var mockedNotify = notify.withReporter(mockGenerator(function (opts) {
should.exist(opts);
should.exist(opts.icon);
should.exist(opts.message);
String(opts.icon).should.equal(testIcon);
String(opts.message).should.equal(testString);
}));
var instream = gulp.src(join(__dirname, "./fixtures/*.txt")),
outstream = mockedNotify({
message: testString,
icon: testIcon
});
outstream.on('data', function(file) {
should.exist(file);
should.exist(file.path);
should.exist(file.contents);
});
outstream.on('end', function() {
done();
});
instream.pipe(outstream);
});
it('should emit error when sub-module returns error', function(done) {

@@ -81,0 +112,0 @@ var mockedNotify = notify.withReporter(function (options, callback) {

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