domify

by component

component / domify

html -> elements

199 Stars 34 Forks Last release: Not found 103 Commits 16 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

domify

Turn HTML into DOM elements x-browser.

Usage

Works out of the box in the browser:

var domify = require('domify');

document.addEventListener('DOMContentLoaded', function() { var el = domify('

Hello there

'); document.body.appendChild(el); });

You can also run it in node and iojs. Just pass a custom implementation of

document
:
var jsdom = require('jsdom').jsdom();

domify('

Hello there

', jsdom.defaultView.document);

Running tests

$ npm i -g component-test
$ make
$ component-test browser

License

MIT

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.