jstd-web/node_modules/domify
liang.chao ae9cf31198 Initial commit 2025-11-25 15:23:22 +08:00
..
Readme.md Initial commit 2025-11-25 15:23:22 +08:00
index.js Initial commit 2025-11-25 15:23:22 +08:00
package.json Initial commit 2025-11-25 15:23:22 +08:00

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 test

License

MIT