@zuisong/happy-dom-deno
TypeScript icon, indicating that this package has built-in type declarations

9.20.3 • Public • Published

Happy DOM Logo

About

Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. It includes many web standards from WHATWG DOM and HTML.

The goal of Happy DOM is to emulate enough of a web browser to be useful for testing, scraping web sites and server-side rendering.

Happy DOM focuses heavily on performance and can be used as an alternative to JSDOM.

DOM Features

  • Custom Elements (Web Components)

  • Shadow Root (Shadow DOM)

  • Declarative Shadow DOM

  • Mutation Observer

  • Tree Walker

  • Fetch

And much more..

Usage

Basic Usage

A simple example of how you can use Happy DOM.

import { Window } from 'npm:@zuisong/happy-dom-deno';

const window = new Window();
const document = window.document;

document.body.innerHTML = '<div class="container"></div>';

const container = document.querySelector('.container');
const button = document.createElement('button');

container.appendChild(button);

// Outputs "<div class="container"><button></button></div>"
console.log(document.body.innerHTML);

/@zuisong/happy-dom-deno/

    Package Sidebar

    Install

    npm i @zuisong/happy-dom-deno

    Weekly Downloads

    14

    Version

    9.20.3

    License

    MIT

    Unpacked Size

    3.74 MB

    Total Files

    1578

    Last publish

    Collaborators

    • zuisong