Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    whir-dodompublic

    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)

    Keywords

    install

    npm i whir-dodom

    Downloadslast 7 days

    0

    version

    0.0.2

    license

    MIT

    repository

    github.com

    last publish

    collaborators

    • avatar