node-terminal-notifier

terminal-notifier is a command-line tool to send Mac OS X User Notifications, which are available in Mac OS X 10.8 and higher..

npm install node-terminal-notifier
1 downloads in the last week
6 downloads in the last month

node-terminal-notifier

Build Status

Based on ruby terminal-notifier.

terminal-notifier is a command-line tool to send Mac OS X User Notifications, which are available in Mac OS X 10.8 and higher.

Install

npm i --save node-terminal-notifier

Example

var Notification = require('node-terminal-notifier');

// Just message
new Notification('Hello');

// Message with title and other opions as well.
new Notification({
  title: 'hello',
  message: 'world!',
  subtitle: 'Pewpew!'
});


// Alternate, without `new`:
var notify = require('node-terminal-notifier').notify;

Options

/**
 * Options    {Mixed}   options        String with message or Object.
 * @param     {String}  .message       The message body of the notification. Note that if this 
 *                                     option is omitted and data is piped to the application, that 
 *                                     data will be used instead.
 * @param     {String}  .title         The title of the notification. This defaults to ‘Terminal’.
 * @param     {String}  .subtitle      The subtitle of the notification.
 * @param     {String}  .sound         The name of a sound to play when the notification appears. 
 *                                     The names are listed in Sound Preferences. Use 'default' 
 *                                     for the default notification sound.
 * @param     {String}  .group         Specifies the ‘group’ a notification belongs to. For any 
 *                                     ‘group’ only one notification will ever be shown, replacing 
 *                                     previously posted notifications.
 */
npm loves you