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 = ;var notification = Notifications;
Notifications.setDefaultOptions(options)
Notifications;
Notifications.setDisplayTime(delay)
Notification; // 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
});