title: How to structure Javascript with Browserify and page specific documentReady functions
body: <p>I'm working on a NodeJS web project and I'm using browserify as my dependency loader.  For now I have one single file <em>app.js</em> where I'm defining all my browser functions, and a grunt process for "browserifing" it into <em>app-bundle.js</em> </p>
  
  <p>I'm looking for suggestions for structuring js into different files (not strictly related to browserify).</p>
  
  <p>My idea is to keep using one main js (<em>app.js</em> > <em>app-bundle.js</em> ) file included in all my pages and inside it I require all the other secondary files (eg <em>ui.js,common.js, page1.js, page2.js</em> etc.) </p>
  
  <p>My biggest doubt is about page specific functions, let's say I have a function to initiate an image gallery <em>initGallery()</em> that has to be called on documentReady only on one of my pages. </p>
  
  <p>How should I structure my js to call this function just on the page who requires it?</p>