UNPKG

html-flavors

Version:
24 lines (17 loc) 474 B
# html-flavors HTML conversion tools Example ========= Convert HTML to React Component: ```javascript 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>); }