title: Implementing full access to data from each module in Browserify
body: <p>I'm bit of confused with <a href="http://browserify.org/" rel="nofollow noreferrer">Browserify</a>. I'm trying to design application with next structure:</p>
  
  <p><img src="https://i.stack.imgur.com/IOZPu.png" alt="Acces structure of application"></p>
  
  <h2>config.js</h2>
  
  <p>module.export = {loaded: false};</p>
  
  <h2>main.js</h2>
  
  <pre><code>var $ = require("jquery");
  
  $(document).ready(function(){
     var App = require("app.js");
     App.start();
  });
  </code></pre>
  
  <h2>app.js</h2>
  
  <pre><code>var TagsManager = require("./mng/tags"); 
  var SettingsManager = require("./mng/settings");
  
  function App(){
     var config = require("./config");
     this.tagsManager = new TagsManager();
     this.settingsManager = new SettingsManager();
     this.method = function(){
         // here i'm changing config json
         config.loaded = true;
     }
  
     this.method(); //writing from this to config
     this.tagsManager.method(); //writing from tags manager 
  
  }
  
  module.exports = new App();
  </code></pre>
  
  <h2>tags.js</h2>
  
  <p>In this module I need to get access config.</p>
  
  <pre><code>function TagsManager(){
      var config = require("./config");
      ...
      this.method = function(){
         config.newProp =  config.loaded ? "This is new property" : null; 
      }
      ...
  }
  
  module.exports = TagsManager();
  </code></pre>
  
  <p>If I'm including config as a module into each other module then in every module I can read and write into config, but when I need read from another module supposed changes in config then I don't see them. I mean that when in app.js I write to config property <code>config.loaded = true</code> and after it I call method in tags manager that writes <code>config.newProp = "This is new property"</code> if <code>config.loaded == true</code>, I see that in tags manager config looks like it was determined in config.js. </p>
  
  <p>Solution to put config to <code>window</code> object looks pretty musch weird. Are there any other solutions? Or I just don't understand how to use Browserify?</p>