title: Always load cached module in NodeJS ESM
body: <p>I do know how NodeJS resolves modules and how the default cashing works, let me illustrate what I know</p>
  <pre><code>function requireCached(_module){
       if(require.cache[require.resolve(_module)]) 
         return require.cache[require.resolve(_module)];
      return require(_module)
  }
  </code></pre>
  <p>so for example if I am doing</p>
  <p><code>firstfile.ts</code></p>
  <pre><code>import x from './x'
  </code></pre>
  <p><code>secondfile.ts</code></p>
  <pre><code>import x from './x'
  </code></pre>
  <p>the <code>x.ts</code> file will be parsed once</p>
  <p>but if I changed the path in <code>secondfile.ts</code> for example and as follows:</p>
  <p><code>secondfile.ts</code>:</p>
  <pre><code>import x from '../src/x'
  </code></pre>
  <p>the x file will be parsed twice and here is my problem, how to make the import statement to load always from cache regardless of the full path, in other words I need the caching to be only on the name of the file and I am sure the file name is unique</p>