title: Using path.join in Node.js to require a specific module
body: <p>I'm generating .js files using a specific template.
  The paths to the modules to require are passed as params to the template.
  Before passing them to the template the paths are created using path.join.</p>
  
  <pre><code>example:
  var path = path.join(process.cwd(), 'location/to/module');
  template(path);
  
  in the template file:
  var result = '/'use strict/';'
      result += 'var testcase = require(' + path + ')';
  </code></pre>
  
  <p>When the file is generated the path inside require looks like this:</p>
  
  <pre><code>require('D:\rootdirectory\directory\deleteCookies.test.js');
  </code></pre>
  
  <p>The backslashes in the path are causing problems.</p>
  
  <p>Can anyone help me, thank you!!</p>