GithubHelp home page GithubHelp logo

cometkim / happy-dom Goto Github PK

View Code? Open in Web Editor NEW

This project forked from capricorn86/happy-dom

1.0 1.0 0.0 5.83 MB

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.

License: MIT License

JavaScript 1.66% TypeScript 98.34%

happy-dom's Introduction

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.

Read more about how to use Happy DOM

DOM Features

  • Custom Elements (Web Components)

  • Shadow Root (Shadow DOM)

  • Declarative Shadow DOM

  • Mutation Observer

  • Tree Walker

  • Fetch

And much more..

Works With

Packages

This repository is a Monorepo. Each package lives under packages/<package>.

This package contains the core functionality of Happy DOM.


This package makes it possible to use Happy DOM with Jest.


A utility that registers Happy DOM globally, which makes it possible to use Happy DOM for testing in a Node environment.


This package has been deprecated.

Happy DOM now supports Declarative Shadow DOM which can be used for server-side rendering of web components.

Performance

Operation JSDOM Happy DOM
Import / Require 333 ms 45 ms
Parse HTML 256 ms 26 ms
Serialize HTML 65 ms 8 ms
Render custom element 214 ms 19 ms
querySelectorAll('tagname') 4.9 ms 0.7 ms
querySelectorAll('.class') 6.4 ms 3.7 ms
querySelectorAll('[attribute]') 4.0 ms 1.7 ms
querySelectorAll('[class~="name"]') 5.5 ms 2.9 ms
querySelectorAll(':nth-child(2n+1)') 10.4 ms 3.8 ms

See how the test was done here

Contributing

Read more about how to develop and contribute

happy-dom's People

Contributors

capricorn86 avatar mas0nshi avatar davidortnercybercom avatar igx89 avatar dkocsis-emarsys avatar jledentu avatar daveed07 avatar fatihcure-jf avatar ayc0 avatar atyn avatar takaya1992 avatar mpope9 avatar luca992 avatar demivan avatar mat3e avatar kalvenschraut avatar sastan avatar petejodo avatar smarlhens avatar lusito avatar mufasa71 avatar tanimodori avatar kombucha avatar a-wing avatar dependabot[bot] avatar itutto avatar markgaze avatar silverwind avatar obadakhalili avatar maxmilton avatar

Stargazers

Roman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.