A lightweight (2kb) html to hyperscript converter that uses the browser's built in DOM and CSS parser.
var dom2hscript = require('dom2hscript');
var html = '<div>Hello world</div>';
var output = dom2hscript.parseHTML(html);
console.log(output);This script is intended to be run in the BROWSER and bundled using a tool like browserify or webpack.
npm install dom2hscriptThis project is using mocha tests run through mochify (browserify + phantomjs)
npm testThese tests should pass out of the box, but if you make any changes to the source code, it may be necessary to run grunt build to generate a new test build.
Submit Issue in Github
Pull Requests are welcome. If you are submitting your own changes, see the "Test" section above.
MIT
https://www.npmjs.com/~dominictarr who wrote hyperscript.
https://www.npmjs.com/~twilson63 who inspired this project with html2hscript