0.5.0 • Published 7 years ago

nw-notifications v0.5.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

nw-notifications

A node module for sending notifications in nw applications.

Install

npm install nw-notifications

Usage

Notifications.create(options)

More displayOptions see NotificationOptions

var Notifications = require('nw-notifications');
var notification = Notifications.create({
  iconUrl: 'icon.png',
  title: 'title',
  message: 'message'
});

Notifications.setDefaultOptions(options)

Notifications.setDefaultOptions({
  iconUrl: 'icon.png'
});

Notifications.setDisplayTime(delay)

Notification.setDisplayTime(20000); // notification will closed 20s later;

Notifications.setLogger(logger)

Default logger is console

Notifications.clear()

Clear all notifications

events

notification.on('shown', function () {
  // displayed
});

notification.on('clicked', function () {
  // clicked message body
});

notification.on('closed', function (reason) {
  console.log(reason); 
  // CLOSED_BY_USER
  // CLOSED_BY_TIMEOUT
  // CLOSED_BY_CLICK
});
0.5.0

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago