Convert Html to Javascript DOM for coding

Hi There
Is there any function in Pinegrow or exists any plugin to convert any html page to a javascript, which creates the DOM for it ?
As I use node.js, where the front end is generally created by Javascript, it would be nice to get Javascript by Html, so Pinegrow could be used to design the frontend using Html and then export them to Javascript.

I think something like this for eg. a table:

<table>
	<tr>
		<td>Name</td>
		<td>Prename</td>
	</tr>
	<tr>
		<td>Tom</td>
		<td>Gelert</td>
	</tr>
	<tr>
		<td>Lucia</td>
		<td>Winogrov</td>
	</tr>
</table>

results to:

var body = document.getElementById();
var table = document.createElement(“table”);
var row = table.insertRow(0);
var col = row.insertCell(0);
col = col.innerHTML = “Prename”;
col = row.insertCell(1);
col = col.innerHTML = “Name”;
var row = table.insertRow(1);
var col = row.insertCell(0);
col = col.innerHTML = “Tom”;
col = row.insertCell(1);
col = col.innerHTML = “Gelert”;
var row = table.insertRow(2);
var col = row.insertCell(0);
col = col.innerHTML = “Lucia”;
col = row.insertCell(1);
col = col.innerHTML = “Winogrov”;

Kind regards,
Thomas

I don’t think there is a converter of this type - conversion to strings, yes, but with full variables I don’t think so. Having said this, is there a reason you can’t serve a static file or use a templating engine? It would be simple enough to use PG to generate a file and then either serve it directly or modify slightly to work with EJS or pug.