title: Node JS, detect production environment
body: <p>When I'm in dev mode I don't want my server to send email and some other stuff so I have this in server.js file:</p>
  
  <pre><code>process.env.NODE_ENV = 'development';
  </code></pre>
  
  <p>When I move it to production i change the value to 'production'.</p>
  
  <p>Problem is of course that it is easy to forget on deployments. Is it possible somehow to detect when server is in production? </p>
  
  <p>If it's not, is it possible to write a batch script that replaces a string in a file?</p>