title: Is it possible to iterate over imported modules in javascript?
body: <p>I have a common exported property, route, in all my imported modules that I would like to access dynamically, but can't work out how to iterate over the list of imported modules. Can this be done?</p>
  
  <pre><code>import User from '/components/user.js';
  import Document from '/components/document.js';
  
  var routes = [];
  [array of imported modules].forEach(m =&gt; routes.push(m.route));
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>So far I've tried the following and can't find the module list on any of them</p>
  
  <pre><code>console.log(User.constructor);
  console.log(Reflect.ownKeys(this));
  console.log(Reflect.ownKeys(User));
  </code></pre>
  
  <p>Where should I be looking?</p>