Skip to content

Commit

Permalink
Updates documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelbr committed Aug 13, 2020
1 parent 860c06e commit e3decb2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

### `v8.0.0`

Breaking changes:

- Expire time for notify-send is made to match macOS and Windows with default time of 10 seconds. The API is changed to take seconds as input and converting it to milliseconds before passing it on to notify-send. See [#341](https://github.com/mikaelbr/node-notifier/pull/341).

### `v7.0.2`

- Updates dependencies
Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ notifier.notify(
sound: true, // Only Notification Center or Windows Toasters
wait: true // Wait with callback, until user action is taken against notification, does not apply to Windows Toasters as they always wait or notify-send as it does not support the wait option
},
function(err, response) {
function (err, response) {
// Response is response from notification
}
);

notifier.on('click', function(notifierObject, options, event) {
notifier.on('click', function (notifierObject, options, event) {
// Triggers if `wait: true` and user clicks notification
});

notifier.on('timeout', function(notifierObject, options) {
notifier.on('timeout', function (notifierObject, options) {
// Triggers if `wait: true` and notification closes
});
```
Expand Down Expand Up @@ -179,7 +179,7 @@ notifier.notify(
dropdownLabel: undefined, // String. Label to be used if multiple actions
reply: false // Boolean. If notification should take input. Value passed as third argument in callback and event emitter.
},
function(error, response, metadata) {
function (error, response, metadata) {
console.log(response, metadata);
}
);
Expand Down Expand Up @@ -278,7 +278,7 @@ notifier.notify(
remove: undefined, // Number. Refer to previously created notification to close.
install: undefined // String (path, application, app id). Creates a shortcut <path> in the start menu which point to the executable <application>, appID used for the notifications.
},
function(error, response) {
function (error, response) {
console.log(response);
}
);
Expand Down Expand Up @@ -333,7 +333,7 @@ notifier.notify(
wait: false, // Wait for User Action against Notification
type: 'info' // The notification type : info | warn | error
},
function(error, response) {
function (error, response) {
console.log(response);
}
);
Expand All @@ -355,10 +355,12 @@ notifier.notify({
message: 'Hello World',
icon: __dirname + '/coulson.jpg',

wait: false, // Defaults no exipre time set. If true expire time of 5 seconds is used
timeout: 10, // Alias for expire-time, time etc. Time before notify-send expires. Defaults to 10 seconds.

// .. and other notify-send flags:
'app-name': 'node-notifier',
urgency: undefined,
time: undefined,
category: undefined,
hint: undefined
});
Expand Down

0 comments on commit e3decb2

Please sign in to comment.