UNPKG

546 BJavaScriptView Raw
1'use strict';
2
3const notifier = require('update-notifier');
4const pkg = require('../package.json');
5const FUN_DISABLE_VERSION_CHECK = 'FUN_DISABLE_VERSION_CHECK';
6
7function notify(updateCheckInterval = 1000 * 60 * 60 * 2) { // default 2 hour
8 const disableVersionCheck = process.env[FUN_DISABLE_VERSION_CHECK];
9 if (
10 disableVersionCheck !== undefined &&
11 disableVersionCheck !== '0' &&
12 disableVersionCheck !== 'false'
13 ) {
14 return;
15 }
16 notifier({
17 pkg,
18 updateCheckInterval
19 }).notify();
20}
21
22module.exports = { notify };
\No newline at end of file