title: How to get a variable from a file to another file in Node.js
body: <p>Here is my first file:</p>
  <pre><code>var self = this;
  var config = {
      'confvar': 'configval'
  };
  </code></pre>
  <p>I want this configuration variable in another file, so I have done this in another file:</p>
  <pre><code>conf = require('./conf');
  url = conf.config.confvar;
  </code></pre>
  <p>But it gives me an error.</p>
  <blockquote>
  <p>TypeError: Cannot read property 'confvar' of undefined</p>
  </blockquote>
  <p>What can I do?</p>