src/util/npm-helper.js
function fetchPackage(packageName, packageVersion) {
    // Get the latest matching version from NPM if a version range is specified
    return JudMarket.info(packageName).then(function(data){
      //todo Market-Injection
      return util.getLatestMatchingNpmVersion(data.fullname, packageVersion).then(
        function (latestVersion) {
          return cachePackage(packageName, latestVersion);
        }
      );
    })
}
function fetchPackage(packageName, packageVersion) {
    // Get the latest matching version from NPM if a version range is specified
    return JudMarket.info(packageName).then(function(data){
      //todo Market-Injection
      return util.getLatestMatchingNpmVersion(data.fullname, packageVersion).then(
        function (latestVersion) {
          return cachePackage(packageName, latestVersion);
        }
      );
    })
}
function fetchPackage ( packageName , packageVersion ) { // Get the latest matching version from NPM if a version range is specified return JudMarket . info ( packageName ) . then ( function ( data ) { //todo Market-Injection return util . getLatestMatchingNpmVersion ( data . fullname , packageVersion ) . then ( function ( latestVersion ) { return cachePackage ( packageName , latestVersion ) ; } ) ; } ) }
Fetches the latest version of a package from NPM that matches the specified version. Returns a promise that
resolves to the directory the NPM package is located in.
@param packageName - name of an npm package
@param packageVersion - requested version or version range
Fetches the latest version of a package from NPM that matches the specified version . Returns a promise that resolves to the directory the NPM package is located in .