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                                ...           7 years ago
  • 0.1.0                                ...           8 years ago
  • 0.0.3                                ...           8 years ago
  • 0.0.2                                ...           8 years ago
Downloads
Today 58
This Week 1,713
This Month 7,305
Last Day 455
Last Week 2,336
Last Month 9,748
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (203)

Copyright 2014 - 2016 © taobao.org |