code: function(dir,recursive,prefix,i18n) {
  			var files,i;
  			try {
  				//Get files
  				files = fs.readdirSync(dir);
  			} catch(err) {
  				//Exit
  				return console.log("Error accessing directory with input template files for " + path + "." +err);
  			}
  			//Log
  			console.log("Processing " + dir);
  			
  			//For each file in dir
  			for(i=0;i<files.length;++i) {
  				//Get file name
  				var name = files[i];
  				//Get full path
  				var file = path.join(dir,name);
  				//Get file stats
  				var stats = fs.statSync(file);
  				//Check if it is a directory 
  				if (stats.isDirectory()) {
  					//If we are recursing
  					if (recursive)
  						//Append files in it
  						walk(file,recursive,(prefix.length?prefix+".":"")+name,i18n);
  				//if it is a template
  				} else if (stats.isFile() && path.extname(file)===".hbs") {
  					//Get template name
  					var template = path.basename(name,".hbs");
  					//If we have a preffix
  					if (prefix.length)
  						//Prepend
  						template = prefix + "." + template;
  					//Log
  					console.log("appending template '" + template +"'");
  					//Read data
  					var data = fs.readFileSync(file, 'utf8');
  					//Add support for i18n with {{[xxx]}} -> {{t 'xxx'}}
  					if (i18n)
  						//Replace
  						data = data.replace(/\{\{\s*\[\s*([^\s]*)\s*\]\s*\}\}/g,"{{t '$1'}}");
  					//Compile and generate entry in template map
  					js += "	templates['" + template + "'] = " + Meteor.SpacebarsCompiler.compile(data, {isTemplate: true}) + ";\r\n";
  				}
  			}
  		}
docs: Traverse dir