whir-dodom

0.0.2 • Public • Published

dodom

Turn arbitrary HTML strings into DOM elements.


var dodom = require('whir-dodom');

var frag = dodom('<h1>hi there</h1>');

frag.querySelector('h1').textContent === 'hi there'; // true

It's not going to catch a load of edge cases, but plenty for simple things. If you need more, then domify will be a better choice.

@todo

  • xss filtering
  • allow variadic invocation (template > insert a holder at some point > return composed fragment)

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.2
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i whir-dodom

Weekly Downloads

0

Version

0.0.2

License

MIT

Last publish

Collaborators

  • dazld