var GiantCorp = {}; GiantCorp.DataParser = (function(){ var uniqueInstance; function constructor(){ var whitespaceRegex = /\s+/; function stripWhitespace(str){ return str.replace(whitespaceRegex,''); } function stringSplit(str,delimiter){ return str.split(delimiter); } return { stringToArray:function(str,delimiter,stripWS){ if(stripWS){ str = stripWhitespace(str); } var outputArray = stringSplit(str,delimiter); return outputArray; } } } return { getInstance:function(){ if(!uniqueInstance){ uniqueInstance = constructor(); } return uniqueInstance; } } })(); console.log( GiantCorp.DataParser.getInstance().stringToArray('hello world',' '));