项目原始demo,不改动
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
Este repositorio está archivado. Puede ver los archivos y clonarlo, pero no puede subir cambios o reportar incidencias ni pedir Pull Requests.

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