title: Import external class in nodejs
body: <p>i´v got a class which i want to export and import it in another file.</p>
  
  <pre><code>//db.js    
  class sqlConn {
        constru....
  }
  
  modules.exports = sqlConn;
  </code></pre>
  
  <p>I tried to import it, but that doenst worked for me...</p>
  
  <pre><code>//main.html
  var sqlConn = require('path_to_file');
  var obj = new sqlConn(...);
  </code></pre>
  
  <p>That gives me following error:</p>
  
  <pre><code>Uncaught Error: Cannot find module 'path_to_file'
  </code></pre>
  
  <p>can someone help me?</p>
  
  <blockquote>
    <p><strong>Edit</strong> on some answers</p>
  </blockquote>
  
  <p>I´m using electron with node.js
  <br>and my class is laying on an html server.</p>
  
  <p>Also i´m trying to import all in an <code>index.html</code> to sahre an <code>electron.exe</code> which imports all with ajax.</p>