convert HTML-like tags into native DOM elements with TagDOM.
You can install TagDOM using npm:
npm install tagdomyou can easily use TagDOM with this minimal syntax:
import {tag} from 'tagdom';
const myelement = tag`<h1 {style="color:red;"}>Hello, World!</h1>`;
document.body.appendChild(myelement);TagDOM can be Whitespace-sensitive sometimes. , for example:
// This may not work โ
const myelement = tag`<h1 {style="color:red;"} >Hello, World!</h1>`;
// you need to remove any whitespace between "}" and ">"
// This may work โ
const myelement = tag`<h1 {style="color:red;"}>Hello, World!</h1>`;This project is licensed under the MIT License.