tasks/node_version.js
function(loc, callback) {
      var command = nvmInit + 'nvm ls';

      if (loc === 'remote') {
        command += '-remote';
      }

      childProcess.exec(command, cmdOpts, function(err, stdout, stderr) {
        var data = stripColorCodes(stdout.toString()).replace(/\s+/g, '|'),
            available = data.split('|');

        for (var i = 0; i < available.length; i++) {
          // Trim whitespace
          available[i] = available[i].replace(/\s/g, '');
          // Validate
          var ver = semver.valid(available[i]);
          if (ver) {
            if (loc === 'remote') {
              remotes.push(ver);
            } else if (loc === 'local') {
              locals.push(ver);
            }
          }
        }

        callback();
      });
    }
function(loc, callback) {
      var command = nvmInit + 'nvm ls';

      if (loc === 'remote') {
        command += '-remote';
      }

      childProcess.exec(command, cmdOpts, function(err, stdout, stderr) {
        var data = stripColorCodes(stdout.toString()).replace(/\s+/g, '|'),
            available = data.split('|');

        for (var i = 0; i < available.length; i++) {
          // Trim whitespace
          available[i] = available[i].replace(/\s/g, '');
          // Validate
          var ver = semver.valid(available[i]);
          if (ver) {
            if (loc === 'remote') {
              remotes.push(ver);
            } else if (loc === 'local') {
              locals.push(ver);
            }
          }
        }

        callback();
      });
    }
Check for available node versions