html -> elements
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
.gitmodules
History.md
LICENSE - MIT
Makefile
Readme.md
component.json
index.js
package.json

Readme.md

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('<p>Hello <em>there</em></p>');
  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('<p>Hello <em>there</em></p>', jsdom.defaultView.document);

Running tests

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

License

MIT