-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtask.js
More file actions
32 lines (24 loc) · 720 Bytes
/
Copy pathtask.js
File metadata and controls
32 lines (24 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const schedule = require('node-schedule');
const { NotificationCenter } = require('node-notifier');
const path = require('path');
sendNoti(process.argv[2])
function sendNoti(rule) {
var notifier = new NotificationCenter({
withFallback: false,
customPath: undefined
});
const job = schedule.scheduleJob(process.argv[2], function () {
notifier.notify({
sound: 'Submarine',
// wait: true,
title: '⚠️健康警告',
message: '你该休息一下啦,缓解疲劳',
icon: path.join(__dirname, 'icon.jpeg'),
closeLabel: 'CANCEL',
actions: 'OK',
},
function (error, response, metadata) {
console.log(response, metadata);
});
})
}