title: How do you share constants in NodeJS modules?
body: <p>Currently I'm doing this:</p>
  
  <p><em>foo.js</em></p>
  
  <pre><code>const FOO = 5;
  
  module.exports = {
      FOO: FOO
  };
  </code></pre>
  
  <p>And using it in <code>bar.js</code>:</p>
  
  <pre><code>var foo = require('foo');
  foo.FOO; // 5
  </code></pre>
  
  <p>Is there a better way to do this? It feels awkward to declare the constant in the exports object.</p>