html-flavors
v0.0.20
Published
HTML conversion tools
Downloads
8
Maintainers
Readme
html-flavors
HTML conversion tools
Example
Convert HTML to React Component:
var flavors = require('html-flavors');
var html = '<div class="row"> <div class="col-md-4">test</div> </div>';
var tree = flavors.parseHtml(html);
var output = flavors.stringifyReactComponent(tree);
console.log(output);
It will output:
function Merged (props) {
return (<root><div className="row"> <div className="col-md-4">test</div> </div></root>);
}