Skip to content

Commit

Permalink
Merge pull request #382 from yoavain/test-nexe-custom-path
Browse files Browse the repository at this point in the history
Fix customPath option in WindowsToaster constructor
  • Loading branch information
mikaelbr authored Feb 1, 2022
2 parents a17b196 + f46fe4d commit db3bbac
Show file tree
Hide file tree
Showing 4 changed files with 3,924 additions and 43 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
npm-debug.log

.DS_Store
.DS_Store
/dist/
27 changes: 27 additions & 0 deletions example/toaster-custom-path.js
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!');
});
Loading

0 comments on commit db3bbac

Please sign in to comment.