How to use the update-notifier.latest function in update-notifier

To help you get started, we’ve selected a few update-notifier examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github XervoIO / cli / lib / modulus.js View on Github external
args = args || [];
  if (typeof args === 'boolean') {
    authRequired = args;
    args = [];
  }

  if (typeof args.length !== 'number') args = [];

  Modulus.io.print('Welcome to ' + 'Modulus'.magenta);

  Diff = Diff({
    packagePath: Path.resolve(__dirname, '..', 'package.json')
  }).update;

  if (Diff) {
    Modulus.io.warning('Your version ' + Diff.current.verbose + ' is behind the latest release ' + Diff.latest.verbose + '.');
    Modulus.io.print('Please update using "npm update -g Modulus"');
  }

  function go() {
    args.push(done);
    command.apply(Modulus, args);
  }

  if (authRequired) {
    Modulus.commands.user.isAuthenticated(function (err, result) {
      if (err) Modulus.io.error(err);
      if (result) go();
      else {
        Modulus.io.error('Need to be logged in to execute this command.');
        Modulus.io.print('Please log in with "Modulus login" command.');
        return done();

update-notifier

Update notifications for your CLI app

BSD-2-Clause
Latest version published 7 months ago

Package Health Score

82 / 100
Full package analysis