control-freak-ide/server/nodejs/testNotifier.js
plastic-hub-dev-node-saturn 538369cff7 latest
2021-05-12 18:35:18 +02:00

23 lines
770 B
JavaScript

const notifier = require('node-notifier');
const path = require('path');
console.log('args',process.argv);
notifier.notify({
title: 'My awesome title',
message: 'Hello from node, Mr. User!',
//icon: path.join(__dirname, 'coulson.jpg'), // Absolute path (doesn't work on balloons)
sound: true, // Only Notification Center or Windows Toasters
wait: true // Wait with callback, until user action is taken against notification
}, function (err, response) {
// Response is response from notification
});
notifier.on('click', function (notifierObject, options) {
// Triggers if `wait: true` and user clicks notification
});
notifier.on('timeout', function (notifierObject, options) {
// Triggers if `wait: true` and notification closes
});