title: How to create a local module in TypeScript
body: <p>I have created in folder <code>src/modules/my-module/</code> which has <code>package.json</code> and defined the main file which exports everything we need.</p>
  
  <p>I can import from it now <code>import {A} from '../../modules/my-module'</code></p>
  
  <p>I want to change the syntax into <code>import {A} from 'my-module'</code> and I have a few reasons for it:</p>
  
  <ul>
  <li>When I move the module to another folder, I do not want to change all the code calling this module.</li>
  <li>Later, I would like to have the possibility to move the module to a separate repository as the npm package and reuse it in multiple projects. I do not want to change all calling code later.</li>
  </ul>
  
  <p>I have managed to compile it by adding to <code>tsconfig.json</code></p>
  
  <pre><code>"paths": {
    "my-module": ["src/modules/my-module"]
  }
  </code></pre>
  
  <p>But I can't run the result via node.js as the node can't find the module. Is there any way to use non-realtive module reference in such scenario.</p>