src/registry.js
function nextVersions (options, nameVersionPairs, checkLatestOnly) {
  check.verify.object(options, 'expected object with options')
  check.verify.array(nameVersionPairs, 'expected array')
  nameVersionPairs = cleanVersions(nameVersionPairs)

  const verbose = verboseLog(options)
  verbose('checking NPM registry')
  var MAX_CHECK_TIMEOUT = options.checkVersionTimeout || 10000

  var fetchPromises = nameVersionPairs.map(fetchVersions.bind(null, options))
  var fetchAllPromise = q.all(fetchPromises)
        .timeout(MAX_CHECK_TIMEOUT, 'timed out waiting for NPM after ' + MAX_CHECK_TIMEOUT + 'ms')

  return fetchAllPromise.then(
    _.partial(filterFetchedVersions, checkLatestOnly),
    q.reject
  )
}
function nextVersions (options, nameVersionPairs, checkLatestOnly) {
  check.verify.object(options, 'expected object with options')
  check.verify.array(nameVersionPairs, 'expected array')
  nameVersionPairs = cleanVersions(nameVersionPairs)

  const verbose = verboseLog(options)
  verbose('checking NPM registry')
  var MAX_CHECK_TIMEOUT = options.checkVersionTimeout || 10000

  var fetchPromises = nameVersionPairs.map(fetchVersions.bind(null, options))
  var fetchAllPromise = q.all(fetchPromises)
        .timeout(MAX_CHECK_TIMEOUT, 'timed out waiting for NPM after ' + MAX_CHECK_TIMEOUT + 'ms')

  return fetchAllPromise.then(
    _.partial(filterFetchedVersions, checkLatestOnly),
    q.reject
  )
}
returns a promise with available new versions