title: How to check the length of the directory in javascript
body: <p>I have two different directories like</p>
  
  <ul>
  <li>dir 1 --> template 1 --> tpl1.html</li>
  <li>dir 2 --> template 1 --> tpl1.html</li>
  </ul>
  
  <p>My requirement is dir 1 has all the js files, css files, icons etc.. but dir 2 will have only html file with same name like dir 1 html files.</p>
  
  <p>Based on different domains on page load i need to make a decision which html needs to load. </p>
  
  <p>I am using require js "text", I want to make the path of the <code>text!path</code> more dynamic.</p>
  
  <p>Inside directory2 i want to check the length first, and then I want to pick the file.</p>
  
  <p>Please suggest me a approach on this.</p>