gitwtfhub

wtf is jsdom?

robertknight/jsdom — explained in plain English

Analysis updated 2026-07-18 · repo last pushed 2015-08-16

JavaScriptAudience · developerComplexity · 2/5DormantSetup · moderate

TL;DR

jsdom simulates a web browser inside Node.js, letting you load HTML, run JavaScript against it, and test pages without opening a real browser.

Mindmap

mindmap
  root((repo))
    What it does
      Fake DOM in JavaScript
      Load HTML from URL or file
      Run JS against a page
    Tech stack
      JavaScript
      io.js
    Use cases
      Automated page testing
      Check links and buttons
      Simulate cookies and login
    Audience
      Developers
      QA engineers
    APIs
      jsdom.env easy mode
      jsdom.jsdom advanced mode

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Load a web page into a simulated browser environment and verify that links, buttons, or content exist.

REASON 2

Load an external library like jQuery into a page and run automated checks against it, without a real browser.

REASON 3

Test cookie-dependent behavior, like login state, by simulating cookies in the fake DOM.

REASON 4

Run external JavaScript files against a loaded page to confirm they behave as expected.

What's in the stack?

JavaScriptio.js

How it stacks up

robertknight/jsdom3rd-eden/ircb.ioa15n/a15n
LanguageJavaScriptJavaScriptJavaScript
Last pushed2015-08-162016-11-162019-04-07
MaintenanceDormantDormantDormant
Setup difficultymoderateeasyeasy
Complexity2/52/52/5
Audiencedeveloperdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Requires io.js rather than standard Node.js, per the README.

Yoink these prompts

Prompt 1
Show me how to use jsdom.env from robertknight/jsdom to load a URL and count its links.
Prompt 2
Explain the difference between jsdom.env and jsdom.jsdom in robertknight/jsdom and when to use each.
Prompt 3
Help me write a test with robertknight/jsdom that checks a button exists and is clickable.
Prompt 4
Walk me through enabling external JavaScript execution safely in robertknight/jsdom for a trusted test page.

Frequently asked questions

wtf is jsdom?

jsdom simulates a web browser inside Node.js, letting you load HTML, run JavaScript against it, and test pages without opening a real browser.

What language is jsdom written in?

Mainly JavaScript. The stack also includes JavaScript, io.js.

Is jsdom actively maintained?

Dormant — no commits in 2+ years (last push 2015-08-16).

How hard is jsdom to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is jsdom for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.