-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #382 from yoavain/test-nexe-custom-path
Fix customPath option in WindowsToaster constructor
- Loading branch information
Showing
4 changed files
with
3,924 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
node_modules | ||
npm-debug.log | ||
|
||
.DS_Store | ||
.DS_Store | ||
/dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const { WindowsToaster } = require('../'); | ||
const path = require('path'); | ||
|
||
const customPath = path.join(__dirname, 'resources', 'snoretoast-x64.exe'); | ||
const notifierOptions = { withFallback: false, customPath }; | ||
const notifier = new WindowsToaster(notifierOptions); | ||
|
||
notifier.notify( | ||
{ | ||
message: 'Hello!', | ||
icon: path.join(__dirname, 'resources', 'coulson.jpg'), | ||
sound: true | ||
}, | ||
function(err, data) { | ||
// Will also wait until notification is closed. | ||
console.log('Waited'); | ||
console.log(JSON.stringify({ err, data })); | ||
} | ||
); | ||
|
||
notifier.on('timeout', () => { | ||
console.log('Timed out!'); | ||
}); | ||
|
||
notifier.on('click', () => { | ||
console.log('Clicked!'); | ||
}); |
Oops, something went wrong.