title: Node js Empty object when executing a function from a required file
body: <p>so i have this news api js file i can run and execute the api and see a full result when consoling </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const NewsAPI = require('newsapi');
  const newsapi = new NewsAPI('2a59HIDDEN1bd60');
  
  
  
    newsapi.v2.sources({
      category: 'technology',
      language: 'en',
      country: 'us'
    }).then( response =&gt; {
    console.log(response)
      return response
    });</code></pre>
  </div>
  </div>
  </p>
  
  <p>but when i require the above code in another file its coming as empty object</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const passport = require("passport");
  const newsapiapi = require("../services/newsApi");
  
  module.exports = (app) =&gt; {
  
  
    app.get(
      "/auth/google",
      passport.authenticate("google", {
        scope: ["profile", "email"],
      })
    );
  
    app.get("/auth/google/callback", passport.authenticate("google"));
    app.get('/api/current_user',(req,res)=&gt;{
        res.send(req.user);
    })
    app.get('/api/newsapi',(req,res)=&gt;{
      var resp =  newsapiapi
      console.log("-----------",resp)
      
      res.send("hello")
  
  })
  };</code></pre>
  </div>
  </div>
  </p>
  
  <p>In other words the object is empty when executing under  app.get('/api/newsapi') but i get the data with no issue on the first code where the api lies</p>