title: ES6 class method not present in instance
body: <p>I am updating my old node.js project to include ES6 features in order to eventually migrate to typescript, but I can't get this class to work. I have defined a class in a separate file:</p>
  
  <pre><code>class Database {
  
  constructor(connectionPool) {
      this._connectionPool = connectionPool;
  }
  
  _getConnection () {
      console.log("getting connection");
      return new Promise((resolve, reject) =&gt; {
          this._connectionPool.getConnection((err, connection) =&gt; {
              if (err) {
                  reject(err);
                  console.log("connection rejected");
              } else {
                  console.log("connection resolved");
                  resolve(connection);
              }
          });
      });
  }
  }
  module.exports = Database;
  </code></pre>
  
  <p>I am then importing this class into another file and trying to create a Database instance:</p>
  
  <pre><code>const mysql = require('mysql');
  const Database = require('./database');
  
  module.exports = databaseInitializer;
  
  function databaseInitializer(config) {
  
      const pool = mysql.createPool(config);
      const db = new Database(pool);
      console.log(Database.toString());
      console.log(db.__proto__);
      return db;
  }
  </code></pre>
  
  <p>Finally, i am using above function to get the database instance:</p>
  
  <pre><code>const database = require('./models/databaseInitializer')(mysqlConfig);
  console.log(database);
  </code></pre>
  
  <p>Now, my database instance has a <code>_connectionPool</code> property, but no prototype and more importantly, no <code>_getConnection</code> property.
  What am I missing?</p>
  
  <p>Thanks and best regards</p>