How to use the update-notifier.update 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 jackfranklin / doccy / bin / cli.js View on Github external
#!/usr/bin/env node
var doccy = require("../doccy.js");
var program = require("commander");
var pjson = require('../package.json');
var glob = require("glob");
var mkdirp = require("mkdirp");
var notifier = require('update-notifier');

if (notifier.update) {
    notifier.notify('Update available: ' + notifier.update.latest);
}

program.version(pjson.version)
  .option('-g, --glob [fileGlob]', 'Run Doccy on all files matching [fileGlob]')
  .option('-o, --output [outputDir]', 'Specify the directory to output documentation to', 'docs')
  .parse(process.argv);

if(program.glob) {
  glob(program.glob, {}, function(err, files) {
    if(files.length) mkdirp(program.output);
    files.forEach(function(file) {
      if(file.indexOf("node_modules") == -1) {
        doccy.init(file, program.output);
      }
    });
  });
github jackfranklin / doccy / bin / cli.js View on Github external
#!/usr/bin/env node
var doccy = require("../doccy.js");
var program = require("commander");
var pjson = require('../package.json');
var glob = require("glob");
var mkdirp = require("mkdirp");
var notifier = require('update-notifier');

if (notifier.update) {
    notifier.notify('Update available: ' + notifier.update.latest);
}

program.version(pjson.version)
  .option('-g, --glob [fileGlob]', 'Run Doccy on all files matching [fileGlob]')
  .option('-o, --output [outputDir]', 'Specify the directory to output documentation to', 'docs')
  .parse(process.argv);

if(program.glob) {
  glob(program.glob, {}, function(err, files) {
    if(files.length) mkdirp(program.output);
    files.forEach(function(file) {
      if(file.indexOf("node_modules") == -1) {
        doccy.init(file, program.output);
      }
    });

update-notifier

Update notifications for your CLI app

BSD-2-Clause
Latest version published 2 months ago

Package Health Score

89 / 100
Full package analysis