SkillAgentSearch skills...

Html2IDOM

Convert a string of HTML into Incremental DOM

Install / Use

/learn @ericponto/Html2IDOM
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

html2idom

Convert a string of HTML into an Incremental DOM render.

HTML parsing done by htmlparser2, which is a very fast and accurate HTML parser. However, it comes at a cost up front as it adds around 40kb (min and gzipped) to your code.

If that dependency is too large,then there is a light version (require("html2idom/light")) using html-parse-stringy, which is much smaller in size, but slower when parsing HTML. If you are only dealing with small sets of HTML, then this option might be better.

Installation

npm install html2idom

Usage

var patchHTML = require("html2idom").patchHTML;

// get you view's el
var el = document.getElementById("view");
var html = "<h1 class='greetings'>Hello, World</h1>";

// apply the HTML to the el via incremental dom
patchHTML(el, HTML);
View on GitHub
GitHub Stars16
CategoryDevelopment
Updated9mo ago
Forks3

Languages

JavaScript

Security Score

67/100

Audited on Jul 7, 2025

No findings