title: Is there a way to update HTML dom everytime a node script is run
body: <p>Every time a node script is run <code>node app.js</code> I need to update a list in the frontend, but it is not possible to manipulate DOM through node.</p>
  <p>in HTML, I want to append children <code>option</code> tags to this</p>
  <pre><code>&lt;body&gt;
      &lt;select name=&quot;endpoints&quot; id=&quot;endpoints&quot;&gt;&lt;/select&gt;
    &lt;/body&gt;
  </code></pre>
  <p>and on server side I came up with this</p>
  <pre><code>var endpointDropdown = document.getElementById(&quot;endpoints&quot;);
  
  endpoints.forEach(function (item) {
    let option = document.createElement(&quot;option&quot;);
    endpointDropdown.appendChild(option);
    option.innerHTML += item;
  });
  </code></pre>
  <p>Every time I run the node script, an array is generated with the required items which I want to display on the frontend. Is there anyway so when I run the script, it passes the array to the js file and then updates the html?</p>