UNPKG

543 BJavaScriptView Raw
1'use strict';
2const notifier = require('update-notifier');
3const pkg = require('../package.json');
4const FUN_DISABLE_VERSION_CHECK = 'FUN_DISABLE_VERSION_CHECK';
5function notify(updateCheckInterval = 1000 * 60 * 30) {
6 const disableVersionCheck = process.env[FUN_DISABLE_VERSION_CHECK];
7 if (disableVersionCheck !== undefined &&
8 disableVersionCheck !== '0' &&
9 disableVersionCheck !== 'false') {
10 return;
11 }
12 notifier({
13 pkg,
14 updateCheckInterval
15 }).notify();
16}
17module.exports = { notify };