title: Sharing common constants and log function in separate files
body: <p>What are my options for sharing constants between different files with the same NodeJS project?</p>
  
  <p>I'm following,
  <a href="https://www.reddit.com/r/javascript/comments/3bo42p/sharing_constants_in_es6_modules/" rel="nofollow noreferrer">https://www.reddit.com/r/javascript/comments/3bo42p/sharing_constants_in_es6_modules/</a></p>
  
  <pre><code>$ cat  constants.js
  const ALABAMA  = 1;
  const ALASKA = 3;
  const ARIZONA =4;
  </code></pre>
  
  <p><strong>UPDATE</strong>, <em>Other details removed as it is not a good example for me to follow for my specific question</em>. </p>
  
  <p>Also, along the same line, </p>
  
  <p>I want to have the common log facility using this package, 
  <a href="https://www.npmjs.com/package/brolog" rel="nofollow noreferrer">https://www.npmjs.com/package/brolog</a></p>
  
  <p>However, I found initializing it in <code>index.js</code> file is not enough for all other files to use it. </p>
  
  <pre><code>const brolog = require('brolog')
  const log = new brolog.Brolog()
  
  const logLevel = process.env['MY_LOG']
  
  if (logLevel) {
    log.level(logLevel)
    log.verbose('Config', 'Log Level set to %s', logLevel, log.level())
  }
  </code></pre>
  
  <p>I don't want to repeat all above setup among all my NodeJS files.</p>
  
  <p>So, how to sharing common constants and log functionality between different files within the same NodeJS project?</p>
  
  <p>PS. This is only a small &amp; simple project, and I don't want to pull-in/use big npm modules like commonJS just for this. </p>