notifications.js 317 B

123456789101112131415
  1. const path = require('path');
  2. const notifier = require('node-notifier');
  3. function notify(title, body) {
  4. const icon = path.join(__dirname, 'icon.png');
  5. notifier.notify({
  6. title: title,
  7. message: body,
  8. icon: icon
  9. });
  10. console.log(`${title}, ${body}`);
  11. }
  12. module.exports = notify;