jsdom
31.0.1 · 13 Nov 2026MIT166.8M / weekRepositoryHomepagenpmAtom feed
12.2.0 is the newest release of 12.x.
In short
1 breaking1 removed4 new7 fixed2 changed
- Breaking
Jsdom now requires Node.js v8.
- Removed
Removed the old jsdom API, as the new API now has all the capabilities you need.
Release note
This major release brings along our new resource loader API, finally bringing all the capabilities from jsdom v9 to the new (jsdom v10+) API. Thanks very much to @sarvaje for his work to make this possible!
Breaking changes:
- Breaking
Jsdom now requires Node.js v8.
- Removed
Removed the old jsdom API, as the new API now has all the capabilities you need.
Updated our
parse5dependency to v5, which changes the format of the node locations returned bydom.nodeLocation().Updated our
whatwg-urldependency to v7, which changes the origin offile:URLs to be an opaque origin (and thusfile:URLs are no longer same origin to each other).
Other changes:
Added
countReset(),dir()anddirxml()methods toconsole.Added the
InputEventclass.Added
window.status.Added
htmlElement.draggable.Fixed
window.frameElementto correctly return an actualHTMLElementinstance, instead of a jsdom internal class.Fixed cloning of
textareaelements to preserve their values.Fixed
select.selectedOptionssometimes returning outdated results.Fixed CSS selection APIs sometimes returning outdated results, especially for state pseudo-class selectors like
:checked.Fixed CSS selection APIs to throw an error for invalid selectors even when used on empty nodes.
Fixed
window.nameto default to the empty string, per spec, instead of"nodejs".Fixed the default User-Agent to say "unknown OS" instead of "undefined" when jsdom is used in web browsers.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.