title: TypeScript module import in nodejs
body: <p>What is best practice for importing modules in nodejs with typescript? I come from c# background so I want to do something like this</p>
  
  <p><strong>MyClass.ts</strong></p>
  
  <pre><code>module MyNamespace {
      export class MyClass {
      }
  }
  </code></pre>
  
  <p><strong>app.ts</strong></p>
  
  <pre><code>// something like using MyNamespace
  new MyNamespace.MyClass();
  </code></pre>
  
  <p>or</p>
  
  <p><strong>MyClass.ts</strong></p>
  
  <pre><code>export class MyClass {
  }
  </code></pre>
  
  <p><strong>app.ts</strong></p>
  
  <pre><code>import MyClass = module("MyClass")
  new MyClass();
  </code></pre>
  
  <p>I know I can do this and it will work, but then I have to think up for two names for each class</p>
  
  <pre><code>import MyClass2 = module("MyClass")
  new MyClass2.MyClass();
  </code></pre>
  
  <p>Point is separating classes to multiple .ts files (preferably one file per class). So question is, how is this done?</p>