title: NODEJS: Call async function outside of class
body: <p>Basically, what I have is a file which contains a class <strong>MyClass</strong> which then contains some other functions within it which is being called by a separate file which works perfectly fine. However, I want to add an async function <strong>outside</strong> this class in the same file, and then call/execute it from one of the functions <strong>inside</strong> the class. It would look something like this:</p>
  
  <pre><code>async function myAsync(){
  
    //do stuff here
  
  }
  
  // Main class
  class MyClass {
  
      firstFunction() {
         //call async function myAsync here
      }
  }
  
  // Exports class back to other file which runs it
  module.exports = MyClass;
  </code></pre>