update-notifier
Advanced tools
Comparing version 0.6.0 to 0.6.1
26
index.js
@@ -8,5 +8,4 @@ 'use strict'; | ||
var latestVersion = require('latest-version'); | ||
var stringLength = require('string-length'); | ||
var isNpm = require('is-npm'); | ||
var repeating = require('repeating'); | ||
var boxen = require('boxen'); | ||
var ONE_DAY = 1000 * 60 * 60 * 24; | ||
@@ -91,20 +90,9 @@ | ||
var line1 = ' Update available: ' + chalk.green.bold(this.update.latest) + | ||
chalk.dim(' (current: ' + this.update.current + ')') + ' '; | ||
var line2 = ' Run ' + chalk.blue('npm install -g ' + this.packageName) + | ||
' to update. '; | ||
var contentWidth = Math.max(stringLength(line1), stringLength(line2)); | ||
var line1rest = contentWidth - stringLength(line1); | ||
var line2rest = contentWidth - stringLength(line2); | ||
var top = chalk.yellow('┌' + repeating('─', contentWidth) + '┐'); | ||
var bottom = chalk.yellow('└' + repeating('─', contentWidth) + '┘'); | ||
var side = chalk.yellow('│'); | ||
var message = '\n' + boxen('Update available ' + chalk.dim(this.update.current) + chalk.reset(' → ') + chalk.green(this.update.latest) + ' \nRun ' + chalk.cyan('npm i -g ' + this.packageName) + ' to update', { | ||
padding: 1, | ||
margin: 1, | ||
borderColor: 'yellow', | ||
borderStyle: 'round' | ||
}); | ||
var message = | ||
'\n\n' + | ||
top + '\n' + | ||
side + line1 + repeating(' ', line1rest) + side + '\n' + | ||
side + line2 + repeating(' ', line2rest) + side + '\n' + | ||
bottom + '\n'; | ||
if (opts.defer === undefined) { | ||
@@ -111,0 +99,0 @@ process.on('exit', function () { |
{ | ||
"name": "update-notifier", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Update notifications for your CLI app", | ||
@@ -10,3 +10,3 @@ "license": "BSD-2-Clause", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "http://sindresorhus.com" | ||
"url": "sindresorhus.com" | ||
}, | ||
@@ -37,2 +37,3 @@ "engines": { | ||
"dependencies": { | ||
"boxen": "^0.3.1", | ||
"chalk": "^1.0.0", | ||
@@ -42,5 +43,3 @@ "configstore": "^1.0.0", | ||
"latest-version": "^2.0.0", | ||
"repeating": "^2.0.0", | ||
"semver-diff": "^2.0.0", | ||
"string-length": "^1.0.0" | ||
"semver-diff": "^2.0.0" | ||
}, | ||
@@ -47,0 +46,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6
9284
110
+ Addedboxen@^0.3.1
+ Addedboxen@0.3.1(transitive)
+ Addedcode-point-at@1.1.0(transitive)
+ Addedfilled-array@1.1.0(transitive)
+ Addedis-fullwidth-code-point@1.0.0(transitive)
+ Addednumber-is-nan@1.0.1(transitive)
+ Addedstring-width@1.0.2(transitive)
+ Addedwidest-line@1.0.0(transitive)
- Removedrepeating@^2.0.0
- Removedstring-length@^1.0.0
- Removedstring-length@1.0.1(transitive)