title: i am importing a async function and trying to use it
body: <p>The following is my async function to read the data    </p>
  
  <pre><code>const fs = require('fs');
  
  module.exports = {
  
      foo: async () =&gt; {
          const a = async () =&gt; {
              filedata = await fs.readFile('./scripts/pairs.json');
              console.log(filedata);
          }
          a()
      }
  }
  </code></pre>
  
  <p>I am importing the data in the second file and tryed using setTimeout but i failed</p>
  
  <blockquote>
    <p>var a =  require('./scripts/2_fundAccounts')</p>
  </blockquote>
  
  <pre><code>app.get('/createaccount',(req,res) =&gt;{
       console.log(setTimeout(()=&gt;a.foo().then((i)=&gt; console.log(i)),5000));
  })
  </code></pre>
  
  <p>i am getting time out error </p>
  
  <p>Timeout {
    _called: false,
    _idleTimeout: 5000,
    _idlePrev: </p>
  
  <p>Next i removed the  setTimout and tryed with then i  am getting undefined </p>
  
  <pre><code>app.get('/createaccount', (req, res) =&gt; {
      console.log(a.foo().then((i) =&gt; console.log(i)))
  })
  </code></pre>
  
  <p>Next I changed the 2_fundaccounts code</p>
  
  <blockquote>
    <p>await a()</p>
  </blockquote>
  
  <p>I got </p>
  
  <pre><code>Server is listing on port 3000
  Promise { &lt;pending&gt; }
  (node:18637) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.
  undefined
  </code></pre>
  
  <p>1) Any suggestions to get promise resolved without any errors </p>
  
  <p>2)plese help me i don't want to change my 2_fundacounts code i am not having wrights </p>
  
  <p>3)if i have to change the 2_fundaccounts tell me what and  how to do it </p>