How to use the latest-version.then function in latest-version

To help you get started, we’ve selected a few latest-version 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 workshopper / workshopper-adventure / lib / commands / update.js View on Github external
function getVersions (shop, callback) {
  var path = require('path')
  var pkgFile = path.resolve(shop.options.appDir, 'package.json')
  try {
    var pkg = require(pkgFile)
  } catch (e) {
    return callback(e)
  }
  require('latest-version')(pkg.name).then(function (latestVersion) {
    exports.info = {
      version: latestVersion
    }
    callback(null, pkg.name, pkg.version, latestVersion)
  }).catch(function (err) {
    console.log(err)
    callback(err)
  })
}
exports.filter = function (shop) {

latest-version

Get the latest version of an npm package

MIT
Latest version published 2 months ago

Package Health Score

83 / 100
Full package analysis

Popular latest-version functions