update-notifier
Advanced tools
Comparing version 2.1.0 to 2.2.0
26
index.js
@@ -5,11 +5,11 @@ 'use strict'; | ||
const format = require('util').format; | ||
const lazyRequire = require('lazy-req')(require); | ||
const importLazy = require('import-lazy')(require); | ||
const configstore = lazyRequire('configstore'); | ||
const chalk = lazyRequire('chalk'); | ||
const semverDiff = lazyRequire('semver-diff'); | ||
const latestVersion = lazyRequire('latest-version'); | ||
const isNpm = lazyRequire('is-npm'); | ||
const boxen = lazyRequire('boxen'); | ||
const xdgBasedir = lazyRequire('xdg-basedir'); | ||
const configstore = importLazy('configstore'); | ||
const chalk = importLazy('chalk'); | ||
const semverDiff = importLazy('semver-diff'); | ||
const latestVersion = importLazy('latest-version'); | ||
const isNpm = importLazy('is-npm'); | ||
const boxen = importLazy('boxen'); | ||
const xdgBasedir = importLazy('xdg-basedir'); | ||
const ONE_DAY = 1000 * 60 * 60 * 24; | ||
@@ -19,3 +19,4 @@ | ||
constructor(options) { | ||
this.options = options = options || {}; | ||
options = options || {}; | ||
this.options = options; | ||
options.pkg = options.pkg || {}; | ||
@@ -39,4 +40,6 @@ | ||
this.callback = options.callback || (() => {}); | ||
this.disabled = 'NO_UPDATE_NOTIFIER' in process.env || | ||
process.argv.indexOf('--no-update-notifier') !== -1; | ||
if (!this.hasCallback) { | ||
if (!this.disabled && !this.hasCallback) { | ||
try { | ||
@@ -75,4 +78,3 @@ const ConfigStore = configstore(); | ||
this.config.get('optOut') || | ||
'NO_UPDATE_NOTIFIER' in process.env || | ||
process.argv.indexOf('--no-update-notifier') !== -1 | ||
this.disabled | ||
) { | ||
@@ -79,0 +81,0 @@ return; |
{ | ||
"name": "update-notifier", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Update notifications for your CLI app", | ||
@@ -39,5 +39,5 @@ "license": "BSD-2-Clause", | ||
"configstore": "^3.0.0", | ||
"import-lazy": "^2.1.0", | ||
"is-npm": "^1.0.0", | ||
"latest-version": "^3.0.0", | ||
"lazy-req": "^2.0.0", | ||
"semver-diff": "^2.0.0", | ||
@@ -47,8 +47,8 @@ "xdg-basedir": "^3.0.0" | ||
"devDependencies": { | ||
"clear-require": "^2.0.0", | ||
"clear-module": "^2.1.0", | ||
"fixture-stdout": "^0.2.1", | ||
"mocha": "*", | ||
"strip-ansi": "^3.0.1", | ||
"xo": "^0.17.0" | ||
"xo": "^0.18.2" | ||
} | ||
} |
@@ -164,2 +164,3 @@ # update-notifier [![Build Status](https://travis-ci.org/yeoman/update-notifier.svg?branch=master)](https://travis-ci.org/yeoman/update-notifier) | ||
- [npm](https://github.com/npm/npm) - Package manager for JavaScript | ||
- [Yeoman](http://yeoman.io) - Modern workflows for modern webapps | ||
@@ -166,0 +167,0 @@ - [AVA](https://ava.li) - Simple concurrent test runner |
11696
146
177
+ Addedimport-lazy@^2.1.0
+ Addedimport-lazy@2.1.0(transitive)
- Removedlazy-req@^2.0.0
- Removedlazy-req@2.0.0(transitive)