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.7.0 to 1.0.0

23

index.js

@@ -12,3 +12,2 @@ 'use strict';

var xdgBasedir = require('xdg-basedir');
var ansiAlign = require('ansi-align');
var ONE_DAY = 1000 * 60 * 60 * 24;

@@ -47,8 +46,10 @@

// expecting error code EACCES or EPERM
var msg =
chalk.yellow(format(' %s update check failed ', options.pkg.name)) +
format('\n Try running with %s or get access ', chalk.cyan('sudo')) +
'\n to the local update config store via \n' +
chalk.cyan(format(' sudo chown -R $USER:$(id -gn $USER) %s ', xdgBasedir.config));
process.on('exit', function () {
var msg = [chalk.yellow(format(' %s update check failed ', options.pkg.name))];
msg.push(format(' Try running with %s or get access ', chalk.cyan('sudo')));
msg.push(' to the local update config store via ');
msg.push(chalk.cyan(format(' sudo chown -R $USER:$(id -gn $USER) %s ', xdgBasedir.config)));
console.error('\n' + boxen(ansiAlign.center(msg).join('\n')));
console.error('\n' + boxen(msg, {align: 'center'}));
});

@@ -110,9 +111,15 @@ }

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', {
opts.message = opts.message || 'Update available ' + chalk.dim(this.update.current) + chalk.reset(' → ') +
chalk.green(this.update.latest) + ' \nRun ' + chalk.cyan('npm i -g ' + this.packageName) + ' to update';
opts.boxenOpts = opts.boxenOpts || {
padding: 1,
margin: 1,
align: 'center',
borderColor: 'yellow',
borderStyle: 'round'
});
};
var message = '\n' + boxen(opts.message, opts.boxenOpts);
if (opts.defer === undefined) {

@@ -119,0 +126,0 @@ process.on('exit', function () {

{
"name": "update-notifier",
"version": "0.7.0",
"version": "1.0.0",
"description": "Update notifications for your CLI app",

@@ -36,4 +36,3 @@ "license": "BSD-2-Clause",

"dependencies": {
"ansi-align": "^1.0.0",
"boxen": "^0.5.1",
"boxen": "^0.6.0",
"chalk": "^1.0.0",

@@ -48,5 +47,7 @@ "configstore": "^2.0.0",

"clear-require": "^1.0.1",
"fixture-stdout": "^0.2.1",
"mocha": "*",
"strip-ansi": "^3.0.1",
"xo": "*"
}
}

@@ -121,3 +121,16 @@ # update-notifier [![Build Status](https://travis-ci.org/yeoman/update-notifier.svg?branch=master)](https://travis-ci.org/yeoman/update-notifier)

#### options.message
Type: `string`<br>
Default: [See the screen shot above](https://github.com/yeoman/update-notifier#update-notifier-)
The message that will be shown when an update is available.
### options.boxenOpts
Type: `object`<br>
Default: `{ padding: 1, margin: 1, borderColor: 'yellow', borderStyle: 'round' }` ([See the screen shot above](https://github.com/yeoman/update-notifier#update-notifier-))
The object that will be passed to [boxen](https://github.com/sindresorhus/boxen).
### User settings

@@ -124,0 +137,0 @@

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