0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/deps/npm/lib/doctor/get-latest-npm-version.js
Kat Marchán c0d858f8bb
deps: upgrade npm beta to 5.0.0-beta.56
PR-URL: https://github.com/nodejs/node/pull/12936
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-05-23 19:39:43 +02:00

15 lines
444 B
JavaScript

var log = require('npmlog')
var fetchPackageMetadata = require('../fetch-package-metadata')
function getLatestNpmVersion (cb) {
var tracker = log.newItem('getLatestNpmVersion', 1)
tracker.info('getLatestNpmVersion', 'Getting npm package information')
fetchPackageMetadata('npm@latest', '.', {}, function (err, d) {
tracker.finish()
if (err) { return cb(err) }
cb(null, d.version)
})
}
module.exports = getLatestNpmVersion