title: Creating a typescript library that can be used in browser and nodejs
body: <p>I would like to create a library that can be used in both - browser and nodejs. For the sake of the argument let's say this is my library:</p>
  
  <pre><code>export default class MyClass {
      public getString(): string {
          return "Message";
      }
  }
  </code></pre>
  
  <p>ES2015 modules are not supported by browsers as of now and I don't want to depend on requirejs or any other module loader when in browser - I would like this library to be consumed just by including the generated .js file using the <code>script</code> tag. It feels that what I want can be achieved by using internal modules (I don't want to pollute the global namespace).
  However when I wrap my code in <code>namespace</code>/<code>module</code> I am having a hard time to get it compiled to as commonjs module.</p>
  
  <p>What is the proper way of achieving what I want? Or, may be, I am getting completely off the rails here being a typescript and javascript noob?</p>