node-notifier
Advanced tools
Comparing version 3.3.0 to 3.4.0
Changelog | ||
=== | ||
### `v3.4.0` | ||
1. Adds Growl as priority over Balloons | ||
### `v3.3.0` | ||
@@ -5,0 +8,0 @@ 1. Adds support for native Windows 7 and earlier (through task bar balloons) |
@@ -22,5 +22,8 @@ /** | ||
utils = require('../utils'), | ||
checkGrowl = require('../checkGrowl'), | ||
Toaster = require('./toaster'), | ||
Growl = require('./growl'); | ||
var hasGrowl = void 0; | ||
var Notifier = function (options) { | ||
@@ -36,5 +39,21 @@ if (!(this instanceof Notifier)) { | ||
var doNotification = function (options, callback) { | ||
options = utils.mapToNotifu(options); | ||
options.p = options.p || 'Node Notification:'; | ||
if (!options.m) { | ||
callback(new Error('Message is required.')); | ||
return this; | ||
} | ||
var argsList = utils.constructArgumentList(options, { | ||
wrapper: '', | ||
noEscape: true, | ||
allowedArguments: allowedArguments | ||
}); | ||
utils.windowsCommand(notifier, argsList, callback); | ||
} | ||
Notifier.prototype.notify = function (options, callback) { | ||
var fallback; | ||
options.title = options.title || 'Node Notification:'; | ||
callback = callback || function (err, data) {}; | ||
@@ -47,3 +66,3 @@ | ||
if (!utils.isLessThanWin8()) { | ||
if (!utils.isLessThanWin8() || hasGrowl === true) { | ||
fallback = new Growl(this.options); | ||
@@ -53,15 +72,12 @@ return fallback.notify(options, callback); | ||
options = utils.mapToNotifu(options); | ||
if (!options.message) { | ||
callback(new Error('Message is required.')); | ||
if (hasGrowl === false) { | ||
doNotification(options, callback); | ||
return this; | ||
} | ||
var argsList = utils.constructArgumentList(options, { | ||
wrapper: '', | ||
noEscape: true, | ||
allowedArguments: allowedArguments | ||
checkGrowl(function (hasGrowlResult) { | ||
hasGrowl = hasGrowlResult; | ||
doNotification(options, callback); | ||
}); | ||
utils.windowsCommand(notifier, argsList, callback); | ||
return this; | ||
@@ -68,0 +84,0 @@ }; |
@@ -7,3 +7,3 @@ /** | ||
utils = require('../utils'), | ||
Growl = require('./growl'); | ||
Balloon = require('./balloon'); | ||
@@ -29,3 +29,3 @@ var Notifier = function (options) { | ||
if (!utils.isWin8()) { | ||
fallback = new Growl(this.options); | ||
fallback = new Balloon(this.options); | ||
return fallback.notify(options, callback); | ||
@@ -32,0 +32,0 @@ } |
{ | ||
"name": "node-notifier", | ||
"version": "3.3.0", | ||
"version": "3.4.0", | ||
"description": "A Node.js module for sending notifications on native Mac, Windows (post and pre 8) and Linux (or Growl as fallback)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -13,3 +13,3 @@ # node-notifier [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url] | ||
- Linux with the notify-osd/notify-send module | ||
- Windows. Using "toasters" for Win8, Balloons for pre Win8. | ||
- Windows. Using "toasters" for Win8, Balloons for pre Win8 (if Growl isn't found). | ||
- Or if no of the above requirements are met, Growl is used. | ||
@@ -27,2 +27,5 @@ | ||
Growl takes precidence over Windows balloons. So if Growl is active, | ||
growl is used, if not, balloons are shown. | ||
If no of the other requirements are met, node-notifier will use Growl. | ||
@@ -33,2 +36,4 @@ You have to have Growl installed on your system. See | ||
See [documentation and flow chart for reporters](./DECISION_FLOW.md) | ||
## Install | ||
@@ -185,5 +190,5 @@ ``` | ||
notifier.notify({ | ||
title: 'Foo', | ||
message: 'Hello World', | ||
icon: __dirname + "/coulson.jpg" | ||
p: 'Foo', // Title (can use title:) | ||
m: 'Hello World', // Message (can use message:) | ||
d: 1000 // Show for 1000 ms | ||
}); | ||
@@ -190,0 +195,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10374921
42
914
233
1
2