项目原始demo,不改动
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
このリポジトリはアーカイブされています。 ファイルの閲覧とクローンは可能ですが、プッシュや、課題・プルリクエストのオープンはできません。
 
 
 
 

47 行
1.4 KiB

  1. var os = require('os');
  2. var utils = require('./lib/utils');
  3. // All notifiers
  4. var NotifySend = require('./notifiers/notifysend');
  5. var NotificationCenter = require('./notifiers/notificationcenter');
  6. var WindowsToaster = require('./notifiers/toaster');
  7. var Growl = require('./notifiers/growl');
  8. var WindowsBalloon = require('./notifiers/balloon');
  9. var options = { withFallback: true };
  10. switch (os.type()) {
  11. case 'Linux':
  12. module.exports = new NotifySend(options);
  13. module.exports.Notification = NotifySend;
  14. break;
  15. case 'Darwin':
  16. module.exports = new NotificationCenter(options);
  17. module.exports.Notification = NotificationCenter;
  18. break;
  19. case 'Windows_NT':
  20. if (utils.isLessThanWin8()) {
  21. module.exports = new WindowsBalloon(options);
  22. module.exports.Notification = WindowsBalloon;
  23. } else {
  24. module.exports = new WindowsToaster(options);
  25. module.exports.Notification = WindowsToaster;
  26. }
  27. break;
  28. default:
  29. if (os.type().match(/BSD$/)) {
  30. module.exports = new NotifySend(options);
  31. module.exports.Notification = NotifySend;
  32. } else {
  33. module.exports = new Growl(options);
  34. module.exports.Notification = Growl;
  35. }
  36. }
  37. // Expose notifiers to give full control.
  38. module.exports.NotifySend = NotifySend;
  39. module.exports.NotificationCenter = NotificationCenter;
  40. module.exports.WindowsToaster = WindowsToaster;
  41. module.exports.WindowsBalloon = WindowsBalloon;
  42. module.exports.Growl = Growl;