mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
19 lines
405 B
TypeScript
19 lines
405 B
TypeScript
import UpdateNotifier = require("update-notifier");
|
|
|
|
let notifier = UpdateNotifier();
|
|
|
|
if (notifier.update) {
|
|
notifier.notify();
|
|
}
|
|
|
|
console.log(notifier.update);
|
|
|
|
// Also exposed as a class
|
|
notifier = new UpdateNotifier.UpdateNotifier({
|
|
updateCheckInterval: 1000 * 60 * 60 * 24 * 7 // 1 week
|
|
});
|
|
|
|
if (notifier.update) {
|
|
notifier.notify({ message: 'Update available: ' + notifier.update.latest });
|
|
}
|