Sample dna-engine application running on node with jsdom
dna-engine.org, a UI templating library, can be run headless (no browser) on Node.js with the DOM provided by jsdom.
Enter the terminal commands:
$ cd node-jsdom-starter
$ npm install
$ node app
// Imports
import { JSDOM } from 'jsdom';
import { dna } from 'dna-engine';
// Setup
const html = `
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>Tasks</title>
</head>
<body>
<p id=task class=dna-template>~~title~~</p>
</body>
</html>
`;
const dom = new JSDOM(html);
dna.initGlobal(dom.window);