title: TypeScript - Loading JSON objects from a directory
body: <p>I'm relatively new to TypeScript and I am facing a problem.</p>
  <p>I have to dynamically load objects from a directory which contains a number of JSON files.
  File names are generated by an export bash script that populates a resource directory.
  I can scroll through the file names, and I'd like to load the objects from a function, such as:</p>
  <pre><code>/**
   * Reads resources from file (JSON format) and add them to the specified mapEntry
   * @param mapEntry Map entry of Map&lt;Accounts, Resource[]&gt;()
   * @param file Resource file name 
   * @returns Merged mapEntry with new resource read from the file
   */
  function addResources(mapEntry: Resource[], file: any): Resource[] {
      // TODO: load resource object from JSON file
      return mapEntry;
  }
  </code></pre>
  <p>I have not found any possible solution, unless I dynamically generate and include typescript files from an external script.</p>
  <p>Any help would be greatly appreciated.
  Giacomo</p>