title: How to make node.js require absolute? (instead of relative)
body: <p>I would like to require my files always by the root of my project and not relative to the current module.</p>
  
  <p>For example if you look at <a href="https://github.com/visionmedia/express/blob/2820f2227de0229c5d7f28009aa432f9f3a7b5f9/examples/downloads/app.js" rel="noreferrer">https://github.com/visionmedia/express/blob/2820f2227de0229c5d7f28009aa432f9f3a7b5f9/examples/downloads/app.js</a> line 6 you will see</p>
  
  <pre><code>express = require('../../')
  </code></pre>
  
  <p>That's really bad IMO. Imagine I would like to put all my examples closer to the root only by one level. That would be impossible, because I would have to update more than 30 examples and many times within each example. To this:</p>
  
  <pre><code>express = require('../')
  </code></pre>
  
  <p>My solution would be to have a special case for root based: if a string starts with an $ then it's relative to the root folder of the project.</p>
  
  <p>Any help is appreciated, thanks</p>
  
  <h1>Update 2</h1>
  
  <p>Now I'm using require.js which allows you to write in one way and works both on client and on server. Require.js also allows you to create custom paths.</p>
  
  <h1>Update 3</h1>
  
  <p>Now I moved to webpack + gulp and I use enhanced-require to handle modules on the server side. See here the rationale: <a href="http://hackhat.com/p/110/module-loader-webpack-vs-requirejs-vs-browserify/" rel="noreferrer">http://hackhat.com/p/110/module-loader-webpack-vs-requirejs-vs-browserify/</a></p>