domify
turn HTML into DOM elements
Last updated 5 years ago by stephenmathieson .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install domify 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.4.0                                ...           latest (5 years ago)

13 Versions

  • 1.4.0                                ...           5 years ago
  • 1.3.3                                ...           6 years ago
  • 1.3.2                                ...           6 years ago
  • 1.3.1                                ...           6 years ago
  • 1.3.0                                ...           6 years ago
  • 1.2.2                                ...           7 years ago
  • 1.2.1                                ...           7 years ago
  • 1.1.1                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
  • 0.2.0                                ...           8 years ago
  • 0.1.0                                ...           8 years ago
  • 0.0.3                                ...           8 years ago
  • 0.0.2                                ...           8 years ago
Downloads
Today 3
This Week 542
This Month 3
Last Day 539
Last Week 2,873
Last Month 11,463
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (204)

Copyright 2014 - 2016 © taobao.org |