Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

update-notifier

Package Overview
Dependencies
Maintainers
6
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

update-notifier - npm Package Compare versions

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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc