nl_tokens: Gets the version of a plugin that should be fetched for a given project based on the plugin s engine information from NPM and the platforms / plugins installed in the project . The cordovaDependencies object in the package . json s engines entry takes the form of an object that maps plugin versions to a series of constraints and semver ranges . For example :
pl_tokens: function getFetchVersion ( projectRoot , pluginInfo , cordovaVersion ) { // Figure out the project requirements if ( pluginInfo . engines && pluginInfo . engines . cordovaDependencies ) { // grab array of already installed plugins var pluginList = plugin_util . getInstalledPlugins ( projectRoot ) ; var pluginMap = { } ; pluginList . forEach ( function ( plugin ) { pluginMap [ plugin . id ] = plugin . <mask> ; } ) ; return cordova_util . getInstalledPlatformsWithVersions ( projectRoot ) . then ( function ( platformVersions ) { return module . exports . determinePluginVersionToFetch ( pluginInfo , pluginMap , platformVersions , cordovaVersion ) ; } ) ; } else { // If we have no engine, we want to fall back to the default behavior events . emit ( 'verbose' , 'npm info for ' + pluginInfo . name + ' did not contain any engine info. Fetching latest release' ) ; return Promise . resolve ( null ) ; } }