OSS Tanbou

emulate a subset of DOM and HTML standards in Node.js for testing and scraping

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
21,695
Primary language
JavaScript
License
MIT
Repository last updated
Sep 22, 2026
On this page

Overview

jsdom implements a subset of web standards, especially WHATWG DOM and HTML, in JavaScript for Node.js. It creates window and document objects that support DOM-oriented testing, server-side parsing, and validation of code that expects browser-like APIs.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Create window and document objects from an HTML string

new JSDOM(html) constructs a DOM and exposes dom.window.document, allowing standard APIs such as querySelector to inspect and manipulate elements.

Sources: [2]

Configure URLs, resource loading, script execution, and visual hints

Options such as url, resources, runScripts, and pretendToBeVisual control relative-URL resolution, subresource loading, script execution, visibility state, and requestAnimationFrame support.

Sources: [2]

Best fit

Fits DOM-dependent unit and integration tests plus server-side HTML analysis

It is useful when code needs browser-like DOM APIs but running a full browser would add unnecessary cost or complexity.

Sources: [2]

Before adoption

It does not perform real layout or rendering

Even with pretendToBeVisual, jsdom does not implement actual layout or rendering. Pixel output, full navigation, and browser-specific behavior still require a real-browser tool such as Playwright.

Sources: [2]

Do not enable script execution for untrusted content

The README warns that the runScripts: 'dangerously' sandbox is not foolproof and code can potentially reach the Node.js environment. Keep script execution disabled for externally supplied HTML.

Sources: [2]

Official sources

  1. [1]jsdom/jsdom repository(2026-09-30)
  2. [2]jsdom README(2026-09-30)
  3. [3]jsdom 30.1.1 package metadata(2026-09-30)
  4. [4]jsdom v30.1.1 release(2026-09-30)
  5. [5]jsdom MIT license(2026-09-30)
Supplemental curator note

jsdom does not reproduce an entire browser; it implements enough web standards for testing and scraping in Node.js. Enabling runScripts: 'dangerously' on untrusted HTML can expose the Node.js environment, so script execution should remain disabled for external input.

Try it in 3 steps

  1. 1

    Install jsdom 30.1.1

    Pin the release in a project that satisfies the Node.js engine requirement.

    npm install jsdom@30.1.1
  2. 2

    Parse HTML with JSDOM

    Create a minimal DOM without enabling script execution.

    const { JSDOM } = require("jsdom"); const dom = new JSDOM("<p>Hello world</p>");
  3. 3

    Query with DOM APIs

    Verify that document and standard DOM APIs are available in Node.js.

    console.log(dom.window.document.querySelector("p").textContent);
Check the official README

Growth

Growth trends · Last 30 days

21,695 Stars

Trend data is still being collected.

Built with

Categories and tags

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • dom-apis
  • html
  • javascript
  • jsdom
  • nodejs
Stars
21,695
Forks
1,809
Watchers
261
Open issues
306
Owner type
Organization
Primary language
JavaScript
License
MIT
Repository last updated
Sep 22, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?