bakery.js 695 B

12345678910111213141516171819202122
  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. });