var VOWELS   = /[aeiou]+/gi;
var WHITE_SPACE = /\s+/g;
var NOTHING  = '';

function tokenize(str){
  return str.split(WHITE_SPACE);
}

function replace(tokens){
  return tokens.map(function(t){
    return t.replace(VOWELS,NOTHING);
  });
}

exports.parse = function parse(string, join){
  if(typeof string !== 'string'){
    throw new TypeError('Expected a string as the first option');
  }

  join = join || false;

  var tokens = tokenize(string);
  var unvoweled = replace(tokens);

  return join ? unvoweled.join('') : unvoweled.join(' ');
};

var VOWELS   = /[aeiou]/gi;
var VOWELS_AND_SPACE = /[aeiou\s]/g;

exports.parse = function parse(string, join){
  if(typeof string !== 'string'){
    throw new TypeError('Expected a string as the first option');
  }

  join = join || false;
  var replacer = VOWELS;
  if (join) {
      replacer = VOWELS_AND_SPACE;
  }

  return string.replace(replacer, '');
};

Reduce amount of transformations by ~66%
Reduce amount of transformations by ~66%
