title: How to use .ejs variable inside js in Node script?
body: <p>I have an app.js file</p>
  
  <pre><code>  async function asyncCall() {
  var consulta = await db_conn.conexion(CONSTANT.CONF_GENERA_REPORTE);
  response.render('pages/report.ejs', { results: consulta.rows });
  }
  asyncCall();
  </code></pre>
  
  <p>and I'm painting a table in a report.ejs file</p>
  
  <pre><code>         ... &lt;tbody&gt;
              &lt;% results.forEach(function(r) { %&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;%=r .store%&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;%=r .create_date.toISOString().slice(0,10) %&gt;
                  &lt;/td&gt;...
  </code></pre>
  
  <p>but i want to use the variable "results" inside the same .ejs file in a script that exports it to excel</p>
  
  <pre><code>&lt;script&gt;
      var wb = XLSX.utils.book_new();
  
      wb.SheetNames.push("Test Sheet");
      var ws_data = &lt;% results %&gt;; //............here
      var ws = XLSX.utils.aoa_to_sheet(ws_data);
      wb.Sheets["Test Sheet"] = ws;
   .....
  &lt;/script&gt;
  </code></pre>