PHP 7.4.33
Preview: index.js Size: 1.60 KB
/var/www/coop-podio-sms.bitkit.dk/httpdocs/node_modules/node-notifier/index.js
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 };

var osType = utils.isWSL() ? 'WSL' : os.type();

switch (osType) {
  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;
  case 'WSL':
    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;

Directory Contents

Dirs: 3 × Files: 6
Name Size Perms Modified Actions
lib DIR
- drwxr-xr-x 2024-05-28 16:34:49
Edit Download
notifiers DIR
- drwxr-xr-x 2024-05-28 16:34:49
Edit Download
vendor DIR
- drwxr-xr-x 2024-05-28 16:34:45
Edit Download
73 B lrw-r--r-- 1985-10-26 08:15:00
Edit Download
12.30 KB lrw-r--r-- 1985-10-26 08:15:00
Edit Download
1.60 KB lrw-r--r-- 1985-10-26 08:15:00
Edit Download
1.04 KB lrw-r--r-- 1985-10-26 08:15:00
Edit Download
2.93 KB lrw-r--r-- 2024-05-28 16:34:56
Edit Download
16.99 KB lrw-r--r-- 1985-10-26 08:15:00
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).