node --input-type=module -e 'import { DomHandler, Element, Text } from "domhandler"; import assert from "node:assert"; const h = new DomHandler(); h.onopentag("p", {}); h.ontext("hi"); h.onclosetag("p"); h.onend(); assert.strictEqual(h.dom.length, 1); const p = h.dom[0]; assert.ok(p instanceof Element); assert.strictEqual(p.name, "p"); assert.strictEqual(p.children.length, 1); assert.ok(p.children[0] instanceof Text); console.log("ok");'
