title: Two variables refers to same config.js File using require (Reference Problem) in Node.js
body: <p>Hello i have this scenario in Node.js</p>
  
  <pre><code>// config.js
  module.exports = {
      dataUrlTest: "http://www.google.com",
  };
  </code></pre>
  
  <blockquote>
    <p></p>
  </blockquote>
  
  <pre><code>#!/usr/bin/env node
  //main.js
  
  var config = require("./config.js");
  var editConfigFile = require("./config.js");
  
  console.log();
  console.log(config["dataUrlTest"]); // output: http://www.google.com
  console.log(editConfigFile["dataUrlTest"]); // output: http://www.google.com
  
  editConfigFile["dataUrlTest"] = "test";
  
  console.log();
  console.log(config["dataUrlTest"]); // output: test
  console.log(editConfigFile["dataUrlTest"]); // output: test
  </code></pre>
  
  <blockquote>
    <p>When i run "node main.js" the output is as follows:</p>
  </blockquote>
  
  <pre><code>http://www.google.com
  http://www.google.com
  
  test
  test
  </code></pre>
  
  <p>as far as i understood from Node.js require function, it passes reference of the file not copying the file to the variable!</p>
  
  <p>My Question is That, is there a way to have a copy of the file instead of having its reference?</p>
  
  <p>I wanna change editConfigFile as value without affecting config variable, </p>
  
  <p>Is there such thing?, i researched about it, didn't find a solution, any ideas? i'll be grateful.</p>