src/cordova/util.js
function getAvailableNpmVersions(module_name) {
    var npm = require('npm');
    return Q.nfcall(npm.load).then(function () {
        return Q.ninvoke(npm.commands, 'view', [module_name, 'versions'], /* silent = */ true).then(function (result) {
            // result is an object in the form:
            //     {'<version>': {versions: ['1.2.3', '1.2.4', ...]}}
            // (where <version> is the latest version)
            return result[Object.keys(result)[0]].versions;
        });
    });
}
function getAvailableNpmVersions(module_name) {
    var npm = require('npm');
    return Q.nfcall(npm.load).then(function () {
        return Q.ninvoke(npm.commands, 'view', [module_name, 'versions'], /* silent = */ true).then(function (result) {
            // result is an object in the form:
            //     {'<version>': {versions: ['1.2.3', '1.2.4', ...]}}
            // (where <version> is the latest version)
            return result[Object.keys(result)[0]].versions;
        });
    });
}
function getAvailableNpmVersions ( module_name ) { var npm = require ( 'npm' ) ; return Q . nfcall ( npm . load ) . then ( function ( ) { return Q . ninvoke ( npm . commands , 'view' , [ module_name , 'versions' ] , /* silent = */ true ) . then ( function ( result ) { // result is an object in the form: //     {'<version>': {versions: ['1.2.3', '1.2.4', ...]}} // (where <version> is the latest version) return result [ Object . keys ( result ) [ 0 ] ] . versions ; } ) ; } ) ; }
Returns a promise for an array of versions available for the specified npm module.
@param {string} module_name - npm module name.
@returns {Promise} Promise for an array of versions.
Returns a promise for an array of versions available for the specified npm module .