dommo
An isomorphic, load-anywhere function to convert an HTML string to a DOM tree.
/* passing in HTML with a single root returns an element */const el = documentbody /* passing in HTML with multiple root elements returns a DocumentFragment */const frag = documentbody
Load anywhere
This library can be loaded anywhere, natively without transpilation.
Node.js:
const dommo =
Within Node.js with ECMAScript Module support enabled:
Within a modern browser ECMAScript Module:
Old browser (adds window.dommo
):
© 2018-19 Lloyd Brookes <75pound@gmail.com>.