You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
695 B

4 years ago
  1. var growly = require('../lib/growly.js');
  2. var notifications = [
  3. { label: 'muffin', dispname: 'Muffin' },
  4. { label: 'cake', dispname: 'Cake' }
  5. ],
  6. muffinopts = { label: 'muffin', icon: 'muffin.png' },
  7. cakeopts = { label: 'cake', title: 'Cake is ready!', icon: 'cake.png', sticky: true };
  8. growly.register('Bakery', 'muffin.png', notifications, function(err) {
  9. if (err) {
  10. console.log(err);
  11. return;
  12. }
  13. growly.notify('Looks like it is half past muffin time!', muffinopts);
  14. growly.notify('Click to deliver', cakeopts, function(err, action) {
  15. console.log('You', action, 'the notification, so the cake is on its way!');
  16. });
  17. });