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 2.1.0 to 2.2.0

5

CHANGELOG.md
Changelog
===
#### `v2.2.0`
1. Adds support for changing host, port and appName for Growl.
2. Adds support for templating on subtitle and open (for Notification Center).
3. Adds support for returning options in function argument style.
#### `v2.1.0`

@@ -5,0 +10,0 @@ 1. Adds `click` and `timeout` events to `notify` object.

@@ -18,2 +18,9 @@ "use strict";

} else {
if (options.host || options.appName || options.port) {
notifier = new notifier.Notification({
host: options.host,
appName: options.appName,
port: options.port
});
}
reporter = notifier.notify.bind(notifier);

@@ -20,0 +27,0 @@ }

33

lib/report.js

@@ -41,6 +41,8 @@ var template = require("lodash.template");

function generate (outputData, object, title, message, templateOptions) {
function generate (outputData, object, title, message, subtitle, open, templateOptions) {
if (object instanceof Error) {
var titleTemplate = template(title);
var messageTemplate = template(message);
var openTemplate = template(open);
var subtitleTemplate = template(subtitle);

@@ -55,2 +57,10 @@ return extend(defaults.error, outputData, {

options: templateOptions
}),
open: openTemplate({
error: object,
options: templateOptions
}),
subtitle: subtitleTemplate({
error: object,
options: templateOptions
})

@@ -75,2 +85,4 @@ });

title = !(object instanceof Error) ? "Gulp notification" : "Error running Gulp",
open = "",
subtitle = "",
outputData = {};

@@ -80,2 +92,5 @@

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

@@ -97,3 +112,15 @@ return false;

}
if (typeof outputData.subtitle === "function") {
subtitle = outputData.subtitle(object);
} else {
subtitle = outputData.subtitle || subtitle;
}
if (typeof outputData.open === "function") {
open = outputData.open(object);
} else {
open = outputData.open || open;
}
if (typeof outputData.message === "function") {

@@ -108,3 +135,3 @@ message = outputData.message(object);

}
return generate(outputData, object, title, message, templateOptions);
return generate(outputData, object, title, message, subtitle, open, templateOptions);
}

20

package.json
{
"name": "gulp-notify",
"version": "2.1.0",
"version": "2.2.0",
"description": "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",

@@ -33,13 +33,13 @@ "keywords": [

"dependencies": {
"gulp-util": "~2.2.12",
"lodash.template": "~2.4.1",
"node-notifier": "^4.0.3",
"node.extend": "^1.0.9",
"through2": "^1.0.0"
"gulp-util": "^3.0.2",
"lodash.template": "^3.0.0",
"node-notifier": "^4.1.0",
"node.extend": "^1.1.3",
"through2": "^0.6.3"
},
"devDependencies": {
"gulp": "^3.6.2",
"gulp-plumber": "^0.6.2",
"mocha": "^2.0.1",
"should": "^4.3.0"
"gulp": "^3.8.10",
"gulp-plumber": "^0.6.6",
"mocha": "^2.1.0",
"should": "^4.6.1"
},

@@ -46,0 +46,0 @@ "engines": {

@@ -108,6 +108,6 @@ # gulp-notify [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url]

The result of the function is used as message.
Vinyl File from gulp stream passed in as argument.
The returned string can be a lodash template as
The result of the function can be a string used as the message or an options object (see below).
If the returned value is a string, it can be a lodash template as
it is passed through [gulp-util.template](https://github.com/gulpjs/gulp-util#templatestring-data).

@@ -114,0 +114,0 @@

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