Nebulous Pumpkin Moons

    dom-lite

    22.9.0 • Public • Published

    DOM lite – Coverage Size Buy Me A Tea

    A small DOM implementation where most of DOM attributes and methods from document are implemented.

    Examples

    const { document, DOMParser, XMLSerializer } = require("dom-lite");
    
    var el = document.createElement("h1");
    el.id = 123;
    el.className = "large";
    
    var fragment = document.createDocumentFragment();
    var text1 = document.createTextNode("hello");
    var text2 = document.createTextNode(" world");
    
    fragment.appendChild(text1);
    fragment.appendChild(text2);
    el.appendChild(fragment);
    
    el.innerHTML;
    // hello world
    el.innerHTML = "<b>hello world</b>"
    el.outerHTML;
    // <h1 id="123" class="large"><b>hello world</b></h1>
    el.querySelectorAll("b");
    // [ "<b>hello world</b>" ]

    Contributing

    Follow Coding Style Guide

    Run tests

    npm install -g jshint c8
    npm install
    npm test
    jshint *.js
    

    External links

    GitHub repo | npm package | DOM spec | Selectors Level 3 | Coveralls coverage
    Buy Me A Tea

    Licence

    Copyright (c) 2014-2022 Lauri Rooden <lauri@rooden.ee>
    The MIT License

    Install

    npm i dom-lite

    DownloadsWeekly Downloads

    237

    Version

    22.9.0

    License

    MIT

    Unpacked Size

    14.7 kB

    Total Files

    3

    Last publish

    Collaborators

    • lauriro