DNA
Progressive Web Components.
Use in Node.js
DNA is a component library based on Document Object Model. In order to work in Node.js it uses the jsdom
library to create a DOM environment.
$ npm i @chialab/dna jsdom
Sample:
// get the module namespace const { Component, customElement, DOM, html, render } = require('@chialab/dna'); @customElement('hello-world') class HelloWorld extends Component { render() { return html`<h1>Hello world!</h1>`; } } const card = render(new HelloWorld()); console.log(card.outerHTML); // -> "<hello-world><h1>Hello world!</h1></hello-world>"