title: How do I setup the dotenv file in Node.js?
body: <p>I am trying to use the <code>dotenv</code> NPM package and it is not working for me. I have a file <code>config/config.js</code> with the following content:</p>
  <pre class="lang-js prettyprint-override"><code>'use strict';
      
  var dotenv = require('dotenv');
  dotenv.load();
  console.log('config');
  </code></pre>
  <p>I have another file <code>.env</code> at the root of my application folder. I also have an environment variable <code>TWILIO_ACCOUNT_SID</code>.</p>
  <p>This is the process I go through while trying to use the environment variables in a certain function:</p>
  <pre><code>$ node
  &gt; require('./config/config.js');
  config
  {}
  &gt; process.env.TWILIO_ACCOUNT_SID
  undefined
  </code></pre>
  <p>I defined the <code>TWILIO_ACCOUNT_SID</code> in my .env file but as soon as I try to output the value in my console, I get an error stating that the variable is undefined.</p>
  <p>I will be very grateful for any support in troubleshooting this issue.</p>