Added logging, changed some directory structure

This commit is contained in:
2018-01-13 21:33:40 -05:00
parent f079a5f067
commit 8e72ffb917
73656 changed files with 35284 additions and 53718 deletions

View File

@@ -0,0 +1,6 @@
example/
test
*.md
node-notifier_flow.png
.eslintrc
.travis.yml

View File

@@ -0,0 +1,216 @@
Changelog
===
### `v5.1.2`
- Adds temporary workaround for `terminal-notifier` memory leak as seen in https://github.com/facebook/jest/issues/2999 and https://github.com/julienXX/terminal-notifier/issues/173.
- Add appName option and hide snoreToast if not setted ([#158](https://github.com/mikaelbr/node-notifier/pull/158))
### `v5.0.2`
Non-obligatory fail. Fixes issue with multiple actions for macOS.
### `v5.0.1`
Obligatory fail. Fixes minor issue with non-JSON output for macOS.
### `v5.0.0`
#### Breaking Changes
*Note/TL;DR*: If you are just using `node-notifier` with things like `message`, `title` and `icon`, v5 should work just as before.
1. CLI is now removed. Can be found in separate project: https://github.com/mikaelbr/node-notifier-cli. This means you no longer get the `notify` bin when installing `node-notifier`. To get this do `npm i [-g] node-notifier-cli`
2. Changed toaster implementation from `toast.exe` to [Snoretoast](https://github.com/KDE/snoretoast). This means if you are using your custom fork, you need to change. SnoreToast has some better default implemented functionality.
3. [terminal-notifier](https://github.com/julienXX/terminal-notifier) dependency has been bumped to `v1.7.1`. With that there can be changes in the API, and supports now reply and buttons. Output has changed to JSON by default, this means the output of some functions of the terminal-notifier has broken. See https://github.com/julienXX/terminal-notifier for more details. See [README](https://github.com/mikaelbr/node-notifier#usage-notificationcenter) for documentation on how to use the new features, or [an example file](https://github.com/mikaelbr/node-notifier/blob/master/example/macInput.js).
4. `notify` method will now throw error if second argument is something else than function (still optional): [#138](https://github.com/mikaelbr/node-notifier/pull/138).
#### Additions
1. Now supports *BSD systems: [#142](https://github.com/mikaelbr/node-notifier/pull/142).
2. With the new toaster implementation you can do more! For instance customize sound and close notification. See all options:
```javascript
{
title: void 0, // String. Required
message: void 0, // String. Required if remove is not defined
icon: void 0, // String. Absolute path to Icon
sound: false, // Bool | String (as defined by http://msdn.microsoft.com/en-us/library/windows/apps/hh761492.aspx)
wait: false, // Bool. Wait for User Action against Notification or times out
id: void 0, // Number. ID to use for closing notification.
appID: void 0, // String. App.ID. Don't create a shortcut but use the provided app id.
remove: void 0, // Number. Refer to previously created notification to close.
install: void 0 // String (path, application, app id). Creates a shortcut <path> in the start menu which point to the executable <application>, appID used for the notifications.
}
```
#### Fixes
1. Fixes new lines on messages on Windows: [#123](https://github.com/mikaelbr/node-notifier/issues/123)
#### Technical Changes
_Internal changes for those who might be interested_.
1. Dependencies bumped
2. Unnecessary dependencies removed (`lodash.deepClone`). Now uses JSON serialize/deserialize instead.
3. Project is auto-formatted by [`prettier`](https://github.com/jlongster/prettier).
4. [Linting is added](https://github.com/mikaelbr/node-notifier/blob/master/.eslintrc)
5. Added way to better debug what is happening by setting `DEBUG` env-var to `true`. See [CONTRIBUTE.md](https://github.com/mikaelbr/node-notifier/blob/master/CONTRIBUTE.md) for more details.
### `v4.6.1`
1. Adds npm ignore file, ignoring tests and examples from package.
2. Fixes CI builds.
### `v4.6.0`
1. Adds support for Icon URL in Growl ([by @gucong3000](https://github.com/mikaelbr/node-notifier/pull/115))
2. Adds options for passing host and port to cli tool ([reported by @el-davo](https://github.com/mikaelbr/node-notifier/issues/106))
3. Fixes sanitize response on `notify` callback ([by @MadLittleMods](https://github.com/mikaelbr/node-notifier/commit/a44454a11eff452a8b55f9fbe291e189ed088708))
4. Fixes use of new line in messages ([by @gucong3000](https://github.com/mikaelbr/node-notifier/pull/115))
5. Fixes use of `file:///xxx` protocol icon paths for Windows 8.1 ([by @gucong3000](https://github.com/mikaelbr/node-notifier/pull/118))
6. Fixes non-TTY usage and piping messages ([reported by @simensen](https://github.com/mikaelbr/node-notifier/issues/109))
7. Updates vendor terminal-notifier version to 1.6.3 ([reported by @kid-icarus](https://github.com/mikaelbr/node-notifier/pull/120))
### `v4.5.0`
#### Additions
1. Adds syntactic sugar for `notify`. Now able to just pass message:
```js
notifier.notify('My message');
```
See [#45](https://github.com/mikaelbr/node-notifier/issues/45) for more info.
#### Fixes
1. Improvements to docs and examples
2. Updates `semver` dependency to support Webpacking with Electron.
### `v4.4.0`
1. Changes to exec terminal-notifier through execFile to allow for asar-packages
2. Adds support for remote growl server
3. Adds support for win7 with electron asar-package
### `v4.3.1`
Obligatory patch fix:
1. Adds new stdin CLI options to docs
### `v4.3.0`
1. Adds support for piping messages in to CLI.
(With `node-notifier` installed as a CLI `npm i -g node-notifier`)
```shell
echo "Message" | notify
echo "Message" | notify -t "My Title"
echo "Some message" | notify -t "My Title" -s
```
### `v4.2.3`
1. Fixed input arguments to CLI to be strings where they should be strings.
### `v4.2.2`
1. Fixed no notification when no message for the CLI. [#58](https://github.com/mikaelbr/node-notifier/pull/58)
2. Changes `which` test to be sync, avoiding some edge cases with multiple notifications.
### `v4.2.1`
1. Minor fix for docs in CLI usage
### `v4.2.0`
1. Adds CLI support.
2. Fixes Debug "HRESULT : 0xC00CE508" exception on Win8. PR [#49](https://github.com/mikaelbr/node-notifier/pull/49)
### `v4.1.2`
1. Fixes correct terminal-notifier (own fork https://github.com/mikaelbr/terminal-notifier)
to support activate / click.
### `v4.1.1`
1. Fixes proper error codes for balloon: #42
2. Removes unused debug files: #41
3. Patches differences between subtitle for notify-send: #43
4. Updates terminal-notifier dependency (removing black borders) #44 #18
### `v4.1.0`
1. Adds support for changing host and port for Growl.
### `v4.0.3`
1. Fixes Notification center issue with multiple callback events.
2. Fixes error in source code: Fixes long-spaces to proper spaces
### `v4.0.2`
1. Fixes issue with immidiate notifu notifications (with `wait : false`)
2. Fixes issue with boolean flags for notifu.
3. Restructures directories. Making it easier to require notifiers directly.
### `v4.0.1`
1. Fixes issue with optional callback for notify-send
### `v4.0.0`
Major changes and breaking API.
1. require('node-notifier') now returns an instance with fallbackable notifications.
```js
var notifier = require('node-notifier');
notifier.notify();
```
2. Introduced a `wait` property (default `false`), to get user input for
Notification Center, Windows Toaster, Windows Balloons and Growl. Sadly not
for notify-send.
```js
var notifier = require('node-notifier');
notifier.notify({ wait: true }, function (err, response) {
// response is response after user have interacted
// with the notification or the notification has timed out.
});
```
3. All notification instances are now event emitters, emitting events
`click` or `timeout`. This is only applicable if `{ wait: true }`.
```js
var notifier = require('node-notifier');
notifier.on('click', function (notificationObject, options) {
// options.someArbitraryData === 'foo'
});
notifier.notify({ wait: true, someArbitraryData: 'foo' });
```
4. WindowsToaster and NotificationCenter now can have sounds by doing `{ sound: true }`.
Default NotificationCenter sound is Bottle. Can still use define sound on
Mac:
```js
var notifier = require('node-notifier');
notifier.notify({ sound: true });
// For mac (same as sound: true on Windows 8)
notifier.notify({ sound: 'Morse' });
```
### `v3.4.0`
1. Adds Growl as priority over Balloons
### `v3.3.0`
1. Adds support for native Windows 7 and earlier (through task bar balloons)
2. Changes growl implementation. Adds better support for GNTP
### `v3.2.1`
1. Fixes support for notifications from folders with spaces on Windows.
### `v3.2.0`
1. Adds native Windows 8 support.
### `v3.1.0`
1. Adds Growl as fallback for Mac OS X pre 10.8.
### `v3.0.6`
1. Fixes typo: Changes Growl app name from `Gulp` to `Node`.
### `v3.0.5`
1. Maps common options between the different notifiers. Allowing for common usage with different notifiers.
### `v3.0.4`
1. Fixes expires for notify-send (Issue #13)
### `v3.0.2`
1. Fixes version check for Mac OS X Yosemite
### `v3.0.0`
1. Updates terminal-notifier to version 1.6.0; adding support for appIcon and contentImage
2. Removes parsing of output sent from notifier (Notification Center)

View File

@@ -0,0 +1,362 @@
# node-notifier [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url]
Send cross platform native notifications using Node.js. Notification Center for macOS,
notify-osd/libnotify-bin for Linux, Toasters for Windows 8/10, or taskbar Balloons for
earlier Windows versions. Growl is used if none of these requirements are met.
[Works well with electron](#within-electron-packaging).
![macOS Screenshot](https://raw.githubusercontent.com/mikaelbr/node-notifier/master/example/mac.png)
![Native Windows Screenshot](https://raw.githubusercontent.com/mikaelbr/node-notifier/master/example/windows.png)
## Input Example macOS Notification Center
![Input Example](https://raw.githubusercontent.com/mikaelbr/node-notifier/master/example/input-example.gif)
## Quick Usage
Show a native notification on macOS, Windows, Linux:
```javascript
const notifier = require('node-notifier');
// String
notifier.notify('Message');
// Object
notifier.notify({
'title': 'My notification',
'message': 'Hello, there!'
});
```
## Requirements
- **macOS**: >= 10.8 or Growl if earlier.
- **Linux**: `notify-osd` or `libnotify-bin` installed (Ubuntu should have this by default)
- **Windows**: >= 8, task bar balloon for Windows < 8. Growl as fallback. Growl takes precedence over Windows balloons.
- **General Fallback**: Growl
See [documentation and flow chart for reporter choice](./DECISION_FLOW.md)
## Install
```shell
npm install --save node-notifier
```
## Cross-Platform Advanced Usage
Standard usage, with cross-platform fallbacks as defined in the
[reporter flow chart](./DECISION_FLOW.md). All of the options
below will work in a way or another on all platforms.
```javascript
const notifier = require('node-notifier');
const path = require('path');
notifier.notify({
title: 'My awesome title',
message: 'Hello from node, Mr. User!',
icon: path.join(__dirname, 'coulson.jpg'), // Absolute path (doesn't work on balloons)
sound: true, // Only Notification Center or Windows Toasters
wait: true // Wait with callback, until user action is taken against notification
}, function (err, response) {
// Response is response from notification
});
notifier.on('click', function (notifierObject, options) {
// Triggers if `wait: true` and user clicks notification
});
notifier.on('timeout', function (notifierObject, options) {
// Triggers if `wait: true` and notification closes
});
```
You can also specify what reporter you want to use if you
want to customize it or have more specific options per system.
See documentation for each reporter below.
Example:
```javascript
const NotificationCenter = require('node-notifier/notifiers/notificationcenter');
new NotificationCenter(options).notify();
const NotifySend = require('node-notifier/notifiers/notifysend');
new NotifySend(options).notify();
const WindowsToaster = require('node-notifier/notifiers/toaster');
new WindowsToaster(options).notify();
const Growl = require('node-notifier/notifiers/growl');
new Growl(options).notify();
const WindowsBalloon = require('node-notifier/notifiers/balloon');
new WindowsBalloon(options).notify();
```
Or if you are using several (or you are lazy):
(note: technically, this takes longer to require)
```javascript
const nn = require('node-notifier');
new nn.NotificationCenter(options).notify();
new nn.NotifySend(options).notify();
new nn.WindowsToaster(options).notify(options);
new nn.WindowsBalloon(options).notify(options);
new nn.Growl(options).notify(options);
```
## Contents
* [Notification Center documentation](#usage-notificationcenter)
* [Windows Toaster documentation](#usage-windowstoaster)
* [Windows Balloon documentation](#usage-windowsballoon)
* [Growl documentation](#usage-growl)
* [Notify-send documentation](#usage-notifysend)
### Usage NotificationCenter
Same usage and parameter setup as [terminal-notifier](https://github.com/julienXX/terminal-notifier).
Native Notification Center requires macOS version 10.8 or higher. If you have
an earlier version, Growl will be the fallback. If Growl isn't installed, an
error will be returned in the callback.
#### Example
Wrapping around [terminal-notifier](https://github.com/julienXX/terminal-notifier), you can
do all terminal-notifier can do through properties to the `notify` method. E.g.
if `terminal-notifier` says `-message`, you can do `{message: 'Foo'}`, or
if `terminal-notifier` says `-list ALL`, you can do `{list: 'ALL'}`. Notification
is the primary focus for this module, so listing and activating do work,
but isn't documented.
### All notification options with their defaults:
```javascript
const NotificationCenter = require('node-notifier').NotificationCenter;
var notifier = new NotificationCenter({
withFallback: false, // Use Growl Fallback if <= 10.8
customPath: void 0 // Relative/Absolute path to binary if you want to use your own fork of terminal-notifier
});
notifier.notify({
'title': void 0,
'subtitle': void 0,
'message': void 0,
'sound': false, // Case Sensitive string for location of sound file, or use one of macOS' native sounds (see below)
'icon': 'Terminal Icon', // Absolute Path to Triggering Icon
'contentImage': void 0, // Absolute Path to Attached Image (Content Image)
'open': void 0, // URL to open on Click
'wait': false, // Wait for User Action against Notification or times out. Same as timeout = 5 seconds
// New in latest version. See `example/macInput.js` for usage
timeout: 5, // Takes precedence over wait if both are defined.
closeLabel: void 0, // String. Label for cancel button
actions: void 0, // String | Array<String>. Action label or list of labels in case of dropdown
dropdownLabel: void 0, // String. Label to be used if multiple actions
reply: false // Boolean. If notification should take input. Value passed as third argument in callback and event emitter.
}, function(error, response, metadata) {
console.log(response, metadata);
});
```
**Note:** `wait` option is shorthand for `timeout: 5` and doesn't make the notification sticky, but sets
timeout for 5 seconds. Without `wait` or `timeout` notifications are just fired and forgotten Without
given any response. To be able to listen for response (like activation/clicked), you have to define a timeout.
This is not true if you have defined `reply`. If using `reply` it's recommended to set a high timeout or no timeout at all.
**For macOS notifications, icon and contentImage, and all forms of reply/actions requires macOS 10.9.**
Sound can be one of these: `Basso`, `Blow`, `Bottle`, `Frog`, `Funk`, `Glass`,
`Hero`, `Morse`, `Ping`, `Pop`, `Purr`, `Sosumi`, `Submarine`, `Tink`.
If sound is simply `true`, `Bottle` is used.
See [specific Notification Center example](./example/advanced.js). Also, [see input example](./example/macInput.js).
**Custom Path clarification**
`customPath` takes a value of a relative or absolute path to the binary of your fork/custom version of terminal-notifier.
Example: `./vendor/terminal-notifier.app/Contents/MacOS/terminal-notifier`
### Usage WindowsToaster
**Note:** There are some limitations for images in native Windows 8 notifications:
The image must be a PNG image, and cannot be over 1024x1024 px, or over over 200Kb.
You also need to specify the image by using an absolute path. These limitations are
due to the Toast notification system. A good tip is to use something like
`path.join` or `path.delimiter` to have cross-platform pathing.
**Windows 10 Note:** You might have to activate banner notification for the toast to show.
From [mikaelbr/gulp-notify#90 (comment)](https://github.com/mikaelbr/gulp-notify/issues/90#issuecomment-129333034)
> You can make it work by going to System > Notifications & Actions. The 'toast' app needs to have Banners enabled. (You can activate banners by clicking on the 'toast' app and setting the 'Show notification banners' to On)
[Snoretoast](https://github.com/KDE/snoretoast) is used to get native Windows Toasts!
```javascript
const WindowsToaster = require('node-notifier').WindowsToaster;
var notifier = new WindowsToaster({
withFallback: false, // Fallback to Growl or Balloons?
customPath: void 0 // Relative/Absolute path if you want to use your fork of SnoreToast.exe
});
notifier.notify({
title: void 0, // String. Required
message: void 0, // String. Required if remove is not defined
icon: void 0, // String. Absolute path to Icon
sound: false, // Bool | String (as defined by http://msdn.microsoft.com/en-us/library/windows/apps/hh761492.aspx)
wait: false, // Bool. Wait for User Action against Notification or times out
id: void 0, // Number. ID to use for closing notification.
appID: void 0, // String. App.ID and app Name. Defaults to empty string.
remove: void 0, // Number. Refer to previously created notification to close.
install: void 0 // String (path, application, app id). Creates a shortcut <path> in the start menu which point to the executable <application>, appID used for the notifications.
}, function(error, response) {
console.log(response);
});
```
### Usage Growl
```javascript
const Growl = require('node-notifier').Growl;
var notifier = new Growl({
name: 'Growl Name Used', // Defaults as 'Node'
host: 'localhost',
port: 23053
});
notifier.notify({
title: 'Foo',
message: 'Hello World',
icon: fs.readFileSync(__dirname + '/coulson.jpg'),
wait: false, // Wait for User Action against Notification
// and other growl options like sticky etc.
sticky: false,
label: void 0,
priority: void 0
});
```
See more information about using
[growly](https://github.com/theabraham/growly/).
### Usage WindowsBalloon
For earlier Windows versions, the taskbar balloons are used (unless
fallback is activated and Growl is running). For balloons, a great
project called [notifu](http://www.paralint.com/projects/notifu/) is used.
```javascript
const WindowsBalloon = require('node-notifier').WindowsBalloon;
var notifier = new WindowsBalloon({
withFallback: false, // Try Windows Toast and Growl first?
customPath: void 0 // Relative/Absolute path if you want to use your fork of notifu
});
notifier.notify({
title: void 0,
message: void 0,
sound: false, // true | false.
time: 5000, // How long to show balloon in ms
wait: false, // Wait for User Action against Notification
type: 'info' // The notification type : info | warn | error
}, function(error, response) {
console.log(response);
});
```
See full usage on the [project homepage: notifu](http://www.paralint.com/projects/notifu/).
### Usage NotifySend
Note: notify-send doesn't support the wait flag.
```javascript
const NotifySend = require('node-notifier').NotifySend;
var notifier = new NotifySend();
notifier.notify({
title: 'Foo',
message: 'Hello World',
icon: __dirname + '/coulson.jpg',
// .. and other notify-send flags:
urgency: void 0,
time: void 0,
category: void 0,
hint: void 0,
});
```
See flags and options [on the man pages](http://manpages.ubuntu.com/manpages/gutsy/man1/notify-send.1.html)
## CLI
CLI is moved to separate project: https://github.com/mikaelbr/node-notifier-cli
## Thanks to OSS
`node-notifier` is made possible through Open Source Software. A very special thanks to all the modules `node-notifier` uses.
* [terminal-notifier](https://github.com/julienXX/terminal-notifier)
* [Snoretoast](https://github.com/KDE/snoretoast)
* [notifu](http://www.paralint.com/projects/notifu/)
* [growly](https://github.com/theabraham/growly/)
[![NPM downloads][npm-downloads]][npm-url]
## Common Issues
### Use inside tmux session
When using node-notifier within a tmux session, it can cause a hang in the system. This can be solved by following the steps described in this comment: https://github.com/julienXX/terminal-notifier/issues/115#issuecomment-104214742
See more info here: https://github.com/mikaelbr/node-notifier/issues/61#issuecomment-163560801
### Custom icon without terminal icon on macOS
Even if you define an icon in the configuration object for `node-notifier`, you will see a small Terminal icon in the notification (see the example at the top of this document). This is the way notifications on macOS work, it always show the parent icon of the application initiating the notification. For node-notifier, terminal-notifier is the initiator and has Terminal icon defined as its icon. To define your custom icon, you need to fork terminal-notifier and build your custom version with your icon. See this issue for more info: https://github.com/mikaelbr/node-notifier/issues/71
### Within Electron Packaging
If packaging your Electron app as an `asar`, you will find node-notifier will fail to load. Due to the way asar works, you cannot execute a binary from within an asar. As a simple solution, when packaging the app into an asar please make sure you `--unpack` the vendor folder of node-notifier, so the module still has access to the notification binaries. To do this, you can do so by using the following command:
```bash
asar pack . app.asar --unpack "./node_modules/node-notifier/vendor/**"
```
### Using Webpack
When using node-notifier inside of webpack, you must add the following snippet to your `webpack.config.js`. The reason this is required, is because node-notifier loads the notifiers from a binary, and so a relative file path is needed. When webpack compiles the modules, it supresses file directories, causing node-notifier to error on certain platforms. To fix/workaround this, you must tell webpack to keep the relative file directories, by doing so, append the following code to your `webpack.config.js`
```javascript
node: {
__filename: true,
__dirname: true
}
```
## License
[MIT License](http://en.wikipedia.org/wiki/MIT_License)
[npm-url]: https://npmjs.org/package/node-notifier
[npm-image]: http://img.shields.io/npm/v/node-notifier.svg?style=flat
[npm-downloads]: http://img.shields.io/npm/dm/node-notifier.svg?style=flat
[travis-url]: http://travis-ci.org/mikaelbr/node-notifier
[travis-image]: http://img.shields.io/travis/mikaelbr/node-notifier.svg?style=flat
[depstat-url]: https://gemnasium.com/mikaelbr/node-notifier
[depstat-image]: http://img.shields.io/gemnasium/mikaelbr/node-notifier.svg?style=flat

View File

@@ -0,0 +1,46 @@
var os = require('os');
var utils = require('./lib/utils');
// All notifiers
var NotifySend = require('./notifiers/notifysend');
var NotificationCenter = require('./notifiers/notificationcenter');
var WindowsToaster = require('./notifiers/toaster');
var Growl = require('./notifiers/growl');
var WindowsBalloon = require('./notifiers/balloon');
var options = { withFallback: true };
switch (os.type()) {
case 'Linux':
module.exports = new NotifySend(options);
module.exports.Notification = NotifySend;
break;
case 'Darwin':
module.exports = new NotificationCenter(options);
module.exports.Notification = NotificationCenter;
break;
case 'Windows_NT':
if (utils.isLessThanWin8()) {
module.exports = new WindowsBalloon(options);
module.exports.Notification = WindowsBalloon;
} else {
module.exports = new WindowsToaster(options);
module.exports.Notification = WindowsToaster;
}
break;
default:
if (os.type().match(/BSD$/)) {
module.exports = new NotifySend(options);
module.exports.Notification = NotifySend;
} else {
module.exports = new Growl(options);
module.exports.Notification = Growl;
}
}
// Expose notifiers to give full control.
module.exports.NotifySend = NotifySend;
module.exports.NotificationCenter = NotificationCenter;
module.exports.WindowsToaster = WindowsToaster;
module.exports.WindowsBalloon = WindowsBalloon;
module.exports.Growl = Growl;

View File

@@ -0,0 +1,24 @@
var net = require('net');
var hasGrowl = false;
module.exports = function(growlConfig, cb) {
if (typeof cb === 'undefined') {
cb = growlConfig;
growlConfig = {};
}
if (hasGrowl) return cb(hasGrowl);
var port = growlConfig.port || 23053;
var host = growlConfig.host || 'localhost';
var socket = net.connect(port, host);
socket.setTimeout(100);
socket.on('connect', function() {
socket.end();
cb(true);
});
socket.on('error', function() {
socket.end();
cb(false);
});
};

View File

@@ -0,0 +1,507 @@
var shellwords = require('shellwords');
var cp = require('child_process');
var semver = require('semver');
var path = require('path');
var url = require('url');
var os = require('os');
var fs = require('fs');
function clone(obj) {
return JSON.parse(JSON.stringify(obj));
}
module.exports.clone = clone;
var escapeQuotes = function(str) {
if (typeof str === 'string') {
return str.replace(/(["$`\\])/g, '\\$1');
} else {
return str;
}
};
var inArray = function(arr, val) {
return arr.indexOf(val) !== -1;
};
var notifySendFlags = {
u: 'urgency',
urgency: 'urgency',
t: 'expire-time',
e: 'expire-time',
expire: 'expire-time',
'expire-time': 'expire-time',
i: 'icon',
icon: 'icon',
c: 'category',
category: 'category',
subtitle: 'category',
h: 'hint',
hint: 'hint'
};
module.exports.command = function(notifier, options, cb) {
notifier = shellwords.escape(notifier);
if (process.env.DEBUG) {
console.info('node-notifier debug info (command):');
console.info('[notifier path]', notifier);
console.info('[notifier options]', options.join(' '));
}
return cp.exec(
notifier + ' ' + options.join(' '),
function(error, stdout, stderr) {
if (error) return cb(error);
cb(stderr, stdout);
}
);
};
module.exports.fileCommand = function(notifier, options, cb) {
if (process.env.DEBUG) {
console.info('node-notifier debug info (fileCommand):');
console.info('[notifier path]', notifier);
console.info('[notifier options]', options.join(' '));
}
return cp.execFile(notifier, options, function(error, stdout, stderr) {
if (error) return cb(error, stdout);
cb(stderr, stdout);
});
};
module.exports.fileCommandJson = function(notifier, options, cb) {
if (process.env.DEBUG) {
console.info('node-notifier debug info (fileCommandJson):');
console.info('[notifier path]', notifier);
console.info('[notifier options]', options.join(' '));
}
return cp.execFile(notifier, options, function(error, stdout, stderr) {
if (error) return cb(error, stdout);
if (!stdout) return cb(error, {});
try {
var data = JSON.parse(stdout);
cb(stderr, data);
} catch (e) {
cb(e, stdout);
}
});
};
module.exports.immediateFileCommand = function(notifier, options, cb) {
if (process.env.DEBUG) {
console.info('node-notifier debug info (notifier):');
console.info('[notifier path]', notifier);
}
notifierExists(notifier, function(exists) {
if (!exists) {
return cb(new Error('Notifier (' + notifier + ') not found on system.'));
}
cp.execFile(notifier, options);
cb();
});
};
function notifierExists(notifier, cb) {
return fs.stat(notifier, function(err, stat) {
if (!err) return cb(stat.isFile());
// Check if Windows alias
if (path.extname(notifier)) {
// Has extentioon, no need to check more
return cb(false);
}
// Check if there is an exe file in the directory
return fs.stat(notifier + '.exe', function(err, stat) {
if (err) return cb(false);
cb(stat.isFile());
});
});
}
var mapAppIcon = function(options) {
if (options.appIcon) {
options.icon = options.appIcon;
delete options.appIcon;
}
return options;
};
var mapText = function(options) {
if (options.text) {
options.message = options.text;
delete options.text;
}
return options;
};
var mapIconShorthand = function(options) {
if (options.i) {
options.icon = options.i;
delete options.i;
}
return options;
};
module.exports.mapToNotifySend = function(options) {
options = mapAppIcon(options);
options = mapText(options);
for (var key in options) {
if (key === 'message' || key === 'title') continue;
if (options.hasOwnProperty(key) && notifySendFlags[key] !== key) {
options[notifySendFlags[key]] = options[key];
delete options[key];
}
}
return options;
};
module.exports.mapToGrowl = function(options) {
options = mapAppIcon(options);
options = mapIconShorthand(options);
options = mapText(options);
if (options.icon && !Buffer.isBuffer(options.icon)) {
try {
options.icon = fs.readFileSync(options.icon);
} catch (ex) {}
}
return options;
};
module.exports.mapToMac = function(options) {
options = mapIconShorthand(options);
options = mapText(options);
if (options.icon) {
options.appIcon = options.icon;
delete options.icon;
}
if (options.sound === true) {
options.sound = 'Bottle';
}
if (options.sound === false) {
delete options.sound;
}
if (options.sound && options.sound.indexOf('Notification.') === 0) {
options.sound = 'Bottle';
}
if (options.wait === true) {
if (!options.timeout) {
options.timeout = 5;
}
delete options.wait;
}
options.json = true;
return options;
};
function isArray(arr) {
return Object.prototype.toString.call(arr) === '[object Array]';
}
function noop() {}
module.exports.actionJackerDecorator = function(emitter, options, fn, mapper) {
options = clone(options);
fn = fn || noop;
if (typeof fn !== 'function') {
throw new TypeError(
'The second argument must be a function callback. You have passed ' +
typeof fn
);
}
return function(err, data) {
var resultantData = data;
var metadata = {};
// Allow for extra data if resultantData is an object
if (resultantData && typeof resultantData === 'object') {
metadata = resultantData;
resultantData = resultantData.activationType;
}
// Sanitize the data
if (resultantData) {
resultantData = resultantData.toLowerCase().trim();
if (resultantData.match(/^activate|clicked$/)) {
resultantData = 'activate';
}
}
fn.apply(emitter, [err, resultantData, metadata]);
if (!mapper || !resultantData) return;
var key = mapper(resultantData);
if (!key) return;
emitter.emit(key, emitter, options, metadata);
};
};
module.exports.constructArgumentList = function(options, extra) {
var args = [];
extra = extra || {};
// Massive ugly setup. Default args
var initial = extra.initial || [];
var keyExtra = extra.keyExtra || '';
var allowedArguments = extra.allowedArguments || [];
var noEscape = extra.noEscape !== void 0;
var checkForAllowed = extra.allowedArguments !== void 0;
var explicitTrue = !!extra.explicitTrue;
var keepNewlines = !!extra.keepNewlines;
var wrapper = extra.wrapper === void 0 ? '"' : extra.wrapper;
var escapeFn = function(arg) {
if (isArray(arg)) {
return removeNewLines(arg.join(','));
}
if (!noEscape) {
arg = escapeQuotes(arg);
}
if (typeof arg === 'string' && !keepNewlines) {
arg = removeNewLines(arg);
}
return wrapper + arg + wrapper;
};
initial.forEach(function(val) {
args.push(escapeFn(val));
});
for (var key in options) {
if (
options.hasOwnProperty(key) &&
(!checkForAllowed || inArray(allowedArguments, key))
) {
if (explicitTrue && options[key] === true) {
args.push('-' + keyExtra + key);
} else if (explicitTrue && options[key] === false) continue;
else args.push('-' + keyExtra + key, escapeFn(options[key]));
}
}
return args;
};
function removeNewLines(str) {
var excapedNewline = process.platform === 'win32' ? '\\r\\n' : '\\n';
return str.replace(/\r?\n/g, excapedNewline);
}
/*
---- Options ----
[-t] <title string> | Displayed on the first line of the toast.
[-m] <message string> | Displayed on the remaining lines, wrapped.
[-p] <image URI> | Display toast with an image, local files only.
[-w] | Wait for toast to expire or activate.
[-id] <id> | sets the id for a notification to be able to close it later.
[-s] <sound URI> | Sets the sound of the notifications, for possible values see http://msdn.microsoft.com/en-us/library/windows/apps/hh761492.aspx.
[-silent] | Don't play a sound file when showing the notifications.
[-appID] <App.ID> | Don't create a shortcut but use the provided app id.
-close <id> | Closes a currently displayed notification, in order to be able to close a notification the parameter -w must be used to create the notification.
*/
var allowedToasterFlags = [
't',
'm',
'p',
'w',
'id',
's',
'silent',
'appID',
'close',
'install'
];
var toasterSoundPrefix = 'Notification.';
var toasterDefaultSound = 'Notification.Default';
module.exports.mapToWin8 = function(options) {
options = mapAppIcon(options);
options = mapText(options);
if (options.icon) {
if (/^file:\/+/.test(options.icon)) {
// should parse file protocol URL to path
options.p = url
.parse(options.icon)
.pathname.replace(/^\/(\w:\/)/, '$1')
.replace(/\//g, '\\');
} else {
options.p = options.icon;
}
delete options.icon;
}
if (options.message) {
// Remove escape char to debug "HRESULT : 0xC00CE508" exception
options.m = options.message.replace(/\x1b/g, '');
delete options.message;
}
if (options.title) {
options.t = options.title;
delete options.title;
}
if (options.appName) {
options.appID = options.appName;
delete options.appName;
} else {
options.appID = ' ';
}
if (typeof options.appID === 'undefined') {
options.appID = ' ';
}
if (typeof options.remove !== 'undefined') {
options.close = options.remove;
delete options.remove;
}
if (options.quiet || options.silent) {
options.silent = options.quiet || options.silent;
delete options.quiet;
}
if (typeof options.sound !== 'undefined') {
options.s = options.sound;
delete options.sound;
}
if (options.s === false) {
options.silent = true;
delete options.s;
}
// Silent takes precedence. Remove sound.
if (options.s && options.silent) {
delete options.s;
}
if (options.s === true) {
options.s = toasterDefaultSound;
}
if (options.s && options.s.indexOf(toasterSoundPrefix) !== 0) {
options.s = toasterDefaultSound;
}
if (options.wait) {
options.w = options.wait;
delete options.wait;
}
for (var key in options) {
// Check if is allowed. If not, delete!
if (
options.hasOwnProperty(key) && allowedToasterFlags.indexOf(key) === -1
) {
delete options[key];
}
}
return options;
};
module.exports.mapToNotifu = function(options) {
options = mapAppIcon(options);
options = mapText(options);
if (options.icon) {
options.i = options.icon;
delete options.icon;
}
if (options.message) {
options.m = options.message;
delete options.message;
}
if (options.title) {
options.p = options.title;
delete options.title;
}
if (options.time) {
options.d = options.time;
delete options.time;
}
if (options.q !== false) {
options.q = true;
} else {
delete options.q;
}
if (options.quiet === false) {
delete options.q;
delete options.quiet;
}
if (options.sound) {
delete options.q;
delete options.sound;
}
if (options.t) {
options.d = options.t;
delete options.t;
}
if (options.type) {
options.t = sanitizeNotifuTypeArgument(options.type);
delete options.type;
}
return options;
};
module.exports.isMac = function() {
return os.type() === 'Darwin';
};
module.exports.isMountainLion = function() {
return os.type() === 'Darwin' &&
semver.satisfies(garanteeSemverFormat(os.release()), '>=12.0.0');
};
module.exports.isWin8 = function() {
return os.type() === 'Windows_NT' &&
semver.satisfies(garanteeSemverFormat(os.release()), '>=6.2.9200');
};
module.exports.isLessThanWin8 = function() {
return os.type() === 'Windows_NT' &&
semver.satisfies(garanteeSemverFormat(os.release()), '<6.2.9200');
};
function garanteeSemverFormat(version) {
if (version.split('.').length === 2) {
version += '.0';
}
return version;
}
function sanitizeNotifuTypeArgument(type) {
if (typeof type === 'string' || type instanceof String) {
if (type.toLowerCase() === 'info') return 'info';
if (type.toLowerCase() === 'warn') return 'warn';
if (type.toLowerCase() === 'error') return 'error';
}
return 'info';
}

View File

@@ -0,0 +1,157 @@
/**
* Wrapper for the notifu 1.6 (http://www.paralint.com/projects/notifu/)
Usage
/t <value> The type of message to display values are:
info The message is an informational message
warn The message is an warning message
error The message is an error message
/d <value> The number of milliseconds to display (omit or 0 for infinit)
/p <value> The title (or prompt) of the ballon
/m <value> The message text
/i <value> Specify an icon to use ("parent" uses the icon of the parent process)
/e Enable ballon tips in the registry (for this user only)
/q Do not play a sound when the tooltip is displayed
/w Show the tooltip even if the user is in the quiet period that follows his very first login (Windows 7 and up)
/xp Use IUserNotification interface event when IUserNotification2 is available
// Kill codes:
2 = Timeout
3 = Clicked
4 = Closed or faded out
*/
var path = require('path');
var notifier = path.resolve(__dirname, '../vendor/notifu/notifu');
var checkGrowl = require('../lib/checkGrowl');
var utils = require('../lib/utils');
var Toaster = require('./toaster');
var Growl = require('./growl');
var os = require('os');
var EventEmitter = require('events').EventEmitter;
var util = require('util');
var hasGrowl = void 0;
module.exports = WindowsBalloon;
function WindowsBalloon(options) {
options = utils.clone(options || {});
if (!(this instanceof WindowsBalloon)) {
return new WindowsBalloon(options);
}
this.options = options;
EventEmitter.call(this);
}
util.inherits(WindowsBalloon, EventEmitter);
function noop() {
}
WindowsBalloon.prototype.notify = function(options, callback) {
var fallback;
var notifierOptions = this.options;
options = utils.clone(options || {});
callback = callback || noop;
if (typeof options === 'string') {
options = { title: 'node-notifier', message: options };
}
var actionJackedCallback = utils.actionJackerDecorator(
this,
options,
callback,
function(data) {
if (data === 'activate') {
return 'click';
}
if (data === 'timeout') {
return 'timeout';
}
return false;
}
);
if (!!this.options.withFallback && utils.isWin8()) {
fallback = fallback || new Toaster(notifierOptions);
return fallback.notify(options, callback);
}
if (
!!this.options.withFallback &&
(!utils.isLessThanWin8() || hasGrowl === true)
) {
fallback = fallback || new Growl(notifierOptions);
return fallback.notify(options, callback);
}
if (!this.options.withFallback || hasGrowl === false) {
doNotification(options, notifierOptions, actionJackedCallback);
return this;
}
checkGrowl(notifierOptions, function(hasGrowlResult) {
hasGrowl = hasGrowlResult;
if (hasGrowl) {
fallback = fallback || new Growl(notifierOptions);
return fallback.notify(options, callback);
}
doNotification(options, notifierOptions, actionJackedCallback);
});
return this;
};
var allowedArguments = [ 't', 'd', 'p', 'm', 'i', 'e', 'q', 'w', 'xp' ];
function doNotification(options, notifierOptions, callback) {
var is64Bit = os.arch() === 'x64';
options = options || {};
options = utils.mapToNotifu(options);
options.p = options.p || 'Node Notification:';
var fullNotifierPath = notifier + (is64Bit ? '64' : '') + '.exe';
var localNotifier = notifierOptions.customPath || fullNotifierPath;
if (!options.m) {
callback(new Error('Message is required.'));
return this;
}
var argsList = utils.constructArgumentList(options, {
wrapper: '',
noEscape: true,
explicitTrue: true,
allowedArguments: allowedArguments
});
if (options.wait) {
return utils.fileCommand(localNotifier, argsList, function(error, data) {
var action = fromErrorCodeToAction(error.code);
if (action === 'error') return callback(error, data);
return callback(null, action);
});
}
utils.immediateFileCommand(localNotifier, argsList, callback);
}
function fromErrorCodeToAction(errorCode) {
switch (errorCode) {
case 2:
return 'timeout';
case 3:
case 6:
case 7:
return 'activate';
case 4:
return 'close';
default:
return 'error';
}
}

View File

@@ -0,0 +1,76 @@
/**
* Wrapper for the growly module
*/
var checkGrowl = require('../lib/checkGrowl');
var utils = require('../lib/utils');
var growly = require('growly');
var EventEmitter = require('events').EventEmitter;
var util = require('util');
var errorMessageNotFound = "Couldn't connect to growl (might be used as a fallback). Make sure it is running";
module.exports = Growl;
var hasGrowl = void 0;
function Growl(options) {
options = utils.clone(options || {});
if (!(this instanceof Growl)) {
return new Growl(options);
}
growly.appname = options.name || 'Node';
this.options = options;
EventEmitter.call(this);
}
util.inherits(Growl, EventEmitter);
Growl.prototype.notify = function(options, callback) {
growly.setHost(this.options.host, this.options.port);
options = utils.clone(options || {});
if (typeof options === 'string') {
options = { title: 'node-notifier', message: options };
}
callback = utils.actionJackerDecorator(this, options, callback, function(
data
) {
if (data === 'click') {
return 'click';
}
if (data === 'timedout') {
return 'timeout';
}
return false;
});
options = utils.mapToGrowl(options);
if (!options.message) {
callback(new Error('Message is required.'));
return this;
}
options.title = options.title || 'Node Notification:';
if (hasGrowl || !!options.wait) {
var localCallback = options.wait ? callback : noop;
growly.notify(options.message, options, localCallback);
if (!options.wait) callback();
return this;
}
checkGrowl(growly, function(didHaveGrowl) {
hasGrowl = didHaveGrowl;
if (!didHaveGrowl) return callback(new Error(errorMessageNotFound));
growly.notify(options.message, options);
callback();
});
return this;
};
function noop() {
}

View File

@@ -0,0 +1,114 @@
/**
* A Node.js wrapper for terminal-notify (with fallback).
*/
var utils = require('../lib/utils');
var Growl = require('./growl');
var path = require('path');
var notifier = path.join(
__dirname,
'../vendor/terminal-notifier.app/Contents/MacOS/terminal-notifier'
);
var EventEmitter = require('events').EventEmitter;
var util = require('util');
var FAILSAFE_TIMEOUT = 30 * 1000;
var errorMessageOsX = 'You need Mac OS X 10.8 or above to use NotificationCenter,' +
' or use Growl fallback with constructor option {withFallback: true}.';
module.exports = NotificationCenter;
function NotificationCenter(options) {
options = utils.clone(options || {});
if (!(this instanceof NotificationCenter)) {
return new NotificationCenter(options);
}
this.options = options;
EventEmitter.call(this);
}
util.inherits(NotificationCenter, EventEmitter);
var activeId = null;
function noop() {}
NotificationCenter.prototype.notify = function(options, callback) {
var fallbackNotifier;
var id = identificator();
options = utils.clone(options || {});
activeId = id;
if (typeof options === 'string') {
options = { title: 'node-notifier', message: options };
}
var timeout;
callback = callback || noop;
if (typeof callback !== 'function') {
throw new TypeError(
'The second argument must be a function callback. You have passed ' +
typeof fn
);
}
var actionJackedCallback = utils.actionJackerDecorator(
this,
options,
function() {
clearTimeout(timeout);
callback.apply(null, arguments);
},
function(data) {
if (activeId !== id) return false;
if (data === 'activate') {
return 'click';
}
if (data === 'timeout') {
return 'timeout';
}
if (data === 'replied') {
return 'replied';
}
return false;
}
);
options = utils.mapToMac(options);
if (!options.message && !options.group && !options.list && !options.remove) {
callback(new Error('Message, group, remove or list property is required.'));
return this;
}
var argsList = utils.constructArgumentList(options);
if (utils.isMountainLion()) {
var cp = utils.fileCommandJson(
this.options.customPath || notifier,
argsList,
actionJackedCallback
);
// Redundancy fallback to prevent memory leak
timeout = setTimeout(
function() {
cp.kill('SIGTERM');
},
FAILSAFE_TIMEOUT
);
return this;
}
if (fallbackNotifier || !!this.options.withFallback) {
fallbackNotifier = fallbackNotifier || new Growl(this.options);
return fallbackNotifier.notify(options, callback);
}
callback(new Error(errorMessageOsX));
return this;
};
function identificator() {
return { _ref: 'val' };
}

View File

@@ -0,0 +1,95 @@
/**
* Node.js wrapper for "notify-send".
*/
var os = require('os');
var which = require('which');
var utils = require('../lib/utils');
var EventEmitter = require('events').EventEmitter;
var util = require('util');
var notifier = 'notify-send';
var hasNotifier = void 0;
module.exports = NotifySend;
function NotifySend(options) {
options = utils.clone(options || {});
if (!(this instanceof NotifySend)) {
return new NotifySend(options);
}
this.options = options;
EventEmitter.call(this);
}
util.inherits(NotifySend, EventEmitter);
function noop() {
}
NotifySend.prototype.notify = function(options, callback) {
options = utils.clone(options || {});
callback = callback || noop;
if (typeof callback !== 'function') {
throw new TypeError(
'The second argument must be a function callback. You have passed ' +
typeof callback
);
}
if (typeof options === 'string') {
options = { title: 'node-notifier', message: options };
}
if (!options.message) {
callback(new Error('Message is required.'));
return this;
}
if (os.type() !== 'Linux' && !os.type().match(/BSD$/)) {
callback(new Error('Only supported on Linux and *BSD systems'));
return this;
}
if (hasNotifier === false) {
callback(new Error('notify-send must be installed on the system.'));
return this;
}
if (hasNotifier || !!this.options.suppressOsdCheck) {
doNotification(options, callback);
return this;
}
try {
hasNotifier = !!which.sync(notifier);
doNotification(options, callback);
} catch (err) {
hasNotifier = false;
return callback(err);
}
return this;
};
var allowedArguments = [ 'urgency', 'expire-time', 'icon', 'category', 'hint' ];
function doNotification(options, callback) {
var initial, argsList;
options = utils.mapToNotifySend(options);
options.title = options.title || 'Node Notification:';
initial = [ options.title, options.message ];
delete options.title;
delete options.message;
argsList = utils.constructArgumentList(options, {
initial: initial,
keyExtra: '-',
allowedArguments: allowedArguments
});
utils.command(notifier, argsList, callback);
}

View File

@@ -0,0 +1,101 @@
/**
* Wrapper for the toaster (https://github.com/nels-o/toaster)
*/
var path = require('path');
var notifier = path.resolve(__dirname, '../vendor/snoreToast/SnoreToast.exe');
var utils = require('../lib/utils');
var Balloon = require('./balloon');
var EventEmitter = require('events').EventEmitter;
var util = require('util');
var fallback = void 0;
module.exports = WindowsToaster;
function WindowsToaster(options) {
options = utils.clone(options || {});
if (!(this instanceof WindowsToaster)) {
return new WindowsToaster(options);
}
this.options = options;
EventEmitter.call(this);
}
util.inherits(WindowsToaster, EventEmitter);
function noop() {
}
var timeoutMessage = 'the toast has timed out';
var successMessage = 'user clicked on the toast';
function hasText(str, txt) {
return str && str.indexOf(txt) !== -1;
}
WindowsToaster.prototype.notify = function(options, callback) {
options = utils.clone(options || {});
callback = callback || noop;
if (typeof options === 'string') {
options = { title: 'node-notifier', message: options };
}
if (typeof callback !== 'function') {
throw new TypeError(
'The second argument must be a function callback. You have passed ' +
typeof fn
);
}
var actionJackedCallback = utils.actionJackerDecorator(
this,
options,
function cb(err, data) {
// Needs to filter out timeout. Not an actual error.
if (err && hasText(data, timeoutMessage)) {
return callback(null, data);
}
callback(err, data);
},
function mapper(data) {
if (hasText(data, successMessage)) {
return 'click';
}
if (hasText(data, timeoutMessage)) {
return 'timeout';
}
return false;
}
);
options.title = options.title || 'Node Notification:';
if (
typeof options.message === 'undefined' &&
typeof options.close === 'undefined'
) {
callback(new Error('Message or ID to close is required.'));
return this;
}
if (!utils.isWin8() && !!this.options.withFallback) {
fallback = fallback || new Balloon(this.options);
return fallback.notify(options, callback);
}
options = utils.mapToWin8(options);
var argsList = utils.constructArgumentList(options, {
explicitTrue: true,
wrapper: '',
keepNewlines: true,
noEscape: true
});
utils.fileCommand(
this.options.customPath || notifier,
argsList,
actionJackedCallback
);
return this;
};

View File

@@ -0,0 +1,89 @@
{
"_args": [
[
"node-notifier@5.1.2",
"C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project"
]
],
"_from": "node-notifier@5.1.2",
"_id": "node-notifier@5.1.2",
"_inBundle": false,
"_integrity": "sha1-L6nhJgX6EACdRFSdb82KY93g5P8=",
"_location": "/react-scripts/node-notifier",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "node-notifier@5.1.2",
"name": "node-notifier",
"escapedName": "node-notifier",
"rawSpec": "5.1.2",
"saveSpec": null,
"fetchSpec": "5.1.2"
},
"_requiredBy": [
"/react-scripts/jest/jest-cli"
],
"_resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.1.2.tgz",
"_spec": "5.1.2",
"_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project",
"author": {
"name": "Mikael Brevik"
},
"bugs": {
"url": "https://github.com/mikaelbr/node-notifier/issues"
},
"dependencies": {
"growly": "^1.3.0",
"semver": "^5.3.0",
"shellwords": "^0.1.0",
"which": "^1.2.12"
},
"description": "A Node.js module for sending notifications on native Mac, Windows (post and pre 8) and Linux (or Growl as fallback)",
"devDependencies": {
"eslint": "^3.13.1",
"eslint-config-semistandard": "^7.0.0",
"eslint-config-standard": "^6.2.1",
"eslint-plugin-promise": "^3.4.0",
"eslint-plugin-standard": "^2.0.1",
"jest": "^18.1.0"
},
"directories": {
"example": "example",
"test": "test"
},
"homepage": "https://github.com/mikaelbr/node-notifier#readme",
"jest": {
"testRegex": "/test/[^_]*.js",
"testEnvironment": "node",
"setupTestFrameworkScriptFile": "./test/_test-matchers.js"
},
"keywords": [
"notification center",
"mac os x 10.8",
"notify",
"terminal-notifier",
"notify-send",
"growl",
"windows 8 notification",
"toaster",
"notification"
],
"license": "MIT",
"main": "index.js",
"name": "node-notifier",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/mikaelbr/node-notifier.git"
},
"scripts": {
"example": "node ./example/message.js",
"example:mac": "node ./example/advanced.js",
"example:mac:input": "node ./example/macInput.js",
"example:windows": "node ./example/toaster.js",
"lint": "eslint example/*.js lib/*.js notifiers/*.js test/**/*.js index.js",
"pretest": "npm run lint",
"test": "jest"
},
"version": "5.1.2"
}

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>15G1004</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>terminal-notifier</string>
<key>CFBundleIconFile</key>
<string>Terminal</string>
<key>CFBundleIdentifier</key>
<string>nl.superalloy.oss.terminal-notifier</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>terminal-notifier</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.7.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>16</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>8A218a</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>16A300</string>
<key>DTSDKName</key>
<string>macosx10.12</string>
<key>DTXcode</key>
<string>0800</string>
<key>DTXcodeBuild</key>
<string>8A218a</string>
<key>LSMinimumSystemVersion</key>
<string>10.8</string>
<key>LSUIElement</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2012-2016 Eloy Durán, Julien Blanchard. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSUserNotificationAlertStyle</key>
<string>alert</string>
</dict>
</plist>

View File

@@ -0,0 +1,29 @@
{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
{\colortbl;\red255\green255\blue255;}
\paperw9840\paperh8400
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
\f0\b\fs24 \cf0 Engineering:
\b0 \
Some people\
\
\b Human Interface Design:
\b0 \
Some other people\
\
\b Testing:
\b0 \
Hopefully not nobody\
\
\b Documentation:
\b0 \
Whoever\
\
\b With special thanks to:
\b0 \
Mom\
}