Skip to content

dustinhayes/to-virtual-dom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Convert an html string into a virtual dom instance

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published