Current collected state Current
Observed since 20 Oct, 19:19 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Framework-agnostic library for parsing HTML into vdom of your choice
A node library for parsing HTML into vdom of your choice.
Differences from html-virtualize:
> npm install 2vdom
pragma: jsx-compatible pragma function, e.g. React.createElementhtml: html to parse. May be an ordinary js string or Node.js BufferPromise that resolves to the parsed tree.let parse = require('2vdom');
let html = "<html>...</html>";
let pragma = React.createElement || deku.element || <some jsx pragma fn>;
let vdom = parse(pragma, html);
// Buffer works too:
parse(pragma, fs.readFileSync('<filename>'))
let pragma = (tagname, attrs, ...children) =>
h(tagname, attrs, children);
// carry on as usual ...
let vdom = parse(pragma, html);
let fileStream = fs.createReadStream('<filename>');
parse.stream(pragma, fileStream)
.then(function(vdom) {
// your code here ...
});
There's a number of limitations of 2vdom that should not affect normal usage. However, if you encounter them in any actual use case or if you have good ideas for overcoming them, please issue or PR.
<!doctype> Again,
because there's no way of conveying these to pragma functions.<html>) at document root. If you have
multiple ones, 2vdom throws away every one but the last element. This is not
a technical limitation, so let me know if you need this feature.> jasmine
2-Clause BSD
Download counts and popularity will appear here as the collector receives them.
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 19:19 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:1cb750c7a41bd7013be5879c4d369d9904e2eb01804a6b0144e2afefb8bde0e6