1var log = require('npmlog') 2var fetchPackageMetadata = require('../fetch-package-metadata') 3 4function getLatestNpmVersion (cb) { 5 var tracker = log.newItem('getLatestNpmVersion', 1) 6 tracker.info('getLatestNpmVersion', 'Getting npm package information') 7 fetchPackageMetadata('npm@latest', '.', {}, function (err, d) { 8 tracker.finish() 9 if (err) { return cb(err) } 10 cb(null, d.version) 11 }) 12} 13 14module.exports = getLatestNpmVersion 15