Social Media Photo by Andrii Ganzevych on Unsplash
uhtml (micro µ html) is one of the smallest, fastest, memory consumption friendly, yet zero-tools based, library to safely help creating or manipulating DOM content.
uhtmlas default{ Hole, render, html, svg, attr }with smart auto-keyed nodes - read keyed or not ? paragraph to know moreuhtml/keyedwith extras{ Hole, render, html, svg, htmlFor, svgFor, attr }, providing keyed utilities - read keyed or not ? paragraph to know moreuhtml/nodewith same default exports but it's for one-off nodes creation only so that no cache or updates are available and it's just an easy way to hook uhtml into your existing project for DOM creation (not manipulation!)uhtml/initwhich returns adocument => uhtml/keyedutility that can be bootstrapped withuhtml/dom, LinkeDOM, JSDOM for either SSR or Workers supportuhtml/domwhich returns a specialized uhtml compliant DOM environment that can be passed to theuhtml/initexport to have 100% same-thing running on both client or Web Worker / Server. This entry exports{ Document, DOMParser }where the former can be used to create a new document while the latter one can parse well formed HTML or SVG content and return the document out of the box.
uhtml/init example
import init from 'uhtml/init';
import { Document } from 'uhtml/dom';
const document = new Document;
const {
Hole,
render,
html, svg,
htmlFor, svgFor,
attr
} = init(document);