title: Run Typescript application with PM2
body: <p>I have an application written in Typescript that runs with PM2. Currently I compile to JavaScript, then use PM2 to start the app. My <code>ecosystem.config.js</code> file looks like this:</p>
  
  <pre><code>module.exports = {
    apps: [
      {
        name: 'My Application',
        script: './dist/server/index.js',
        env_qa: {
          PORT: 3001,
          NODE_ENV: 'production',
        },
        env_production: {
          PORT: 3000,
          NODE_ENV: 'production',
        },
      },
    ],
  };
  </code></pre>
  
  <p>I run this with the command:</p>
  
  <p><code>pm2 stop ecosystem.config.js --env qa</code></p>
  
  <p>When developing, I just run <code>ts-node server</code> instead of compiling and using PM2. I recently read that ts-node has a 'transpileOnly' or 'fast' mode meaning it can be used in production. Firstly, I'd like to know if it's true that this can be used in production environments. Secondly, how would I still use PM2 to launch my app but using ts-node?</p>