title: ejs async true with node Express
body: <p>I want to call some of my functions which are asynchronous to be called from within my ejs files.</p>
  
  <p>Like I have this functions set as my <code>app.locals.someFunction</code></p>
  
  <pre class="lang-js prettyprint-override"><code>async someFunction(param){
    let data = await someAsyncStuff();
    // &amp;  other things
    return data;
  }
  </code></pre>
  
  <p>and I want to use it inside ejs file as below:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;%
  let data = await someFunction()
  for(let x of data){%&gt;
  
     &lt;li&gt;&lt;%=x%&gt;&lt;/li&gt;
  
  &lt;%}%&gt;
  </code></pre>
  
  <p>This is possible with ejs if <code>{async:true}</code> is passed as an option. But where exactly should I pass this when my view engine setup is like the following?</p>
  
  <pre class="lang-js prettyprint-override"><code>
  //view engine setup
  app.engine ('.html', ejs.renderFile);
  app.set ('view engine', 'html');
  
  </code></pre>