Skip to content

Latest commit

 

History

History
35 lines (21 loc) · 851 Bytes

README.md

File metadata and controls

35 lines (21 loc) · 851 Bytes

to-virtual-dom

Build Status

Sauce Test Status

Convert an html string into a virtual dom instance

Install

from npm

npm install --save to-virtual-dom

API

tovdom(html, [callback])

Pass an html string to be parsed and converted into a virtual dom instance. The optional callback will be passed the virtual dom instance, which will also be returned by tovdom.

var tovdom = require('to-virtual-dom');

var html = '<div id="yay"><span>smelly cat</span></div>';
var vdom = tovdom(html);

vdom.properties.id; // => yay
vdom.children[0].text; // => smelly cat

License

MIT