jsdom
31.0.1 · 13 Nov 2026MIT166.8M / weekRepositoryHomepagenpmAtom feed
Upgrading jsdom From 5.6.1 to 6.0.0
1 release in betweenevery note read
- 1
- change to make
- 0
- advisories fixed
- 4
- new
- 3
- fixes
Before you upgrade
Tick each one off as you go- Breaking6.0.0
Release by release
- Breaking
The potential breaking changes are highlighted in bold below; the largest ones are around the
jsdom.enverror-handling paradigm. - New
Overhauled the named properties tracker to not walk the entire tree, thus greatly speeding up the setting of
idandnameattributes (including during parsing). - New
Overhauled everything dealing with tree traversal to use a new library, symbol-tree, to turn many operations that were previously O(n^2) or O(n) into O(n) or O(1).
- New
Sped up
node.compareDocumentPositionand anything that used it (likenode.contains) by doing more intelligent tree traversal instead of directly implementing the specced algorithm.
- Breaking
8 other lines we could not sort, mostly version bumps
- 6.0.0
io.js 2.0 onward is now required, as we have begun using ES2015 features only present there.
- 6.0.0
window.onerror(orwindow.addEventListener("error", ...)) now work, and will catch all script errors, similar to in browsers. This also introduces theErrorEventclass, incidentally. - 6.0.0
The virtual console is now the destination for several types of errors from jsdom, using the new event
"jsdomError". This includes: errors loading external resources; script execution errors unhandled bywindow.onerror; and not-implemented warnings resulting from calling methods likewindow.alertwhich jsdom explicitly does not support. - 6.0.0
The
load(errors, window)callback was changed toonload(window), to reflect that it is now just sugar for setting awindow.onloadhandler. - 6.0.0
The
done(errors, window)callback (i.e., the default callback forjsdom.env) has becomedone(error, window), and like every other io.js callback now simply gives you a single error object, instead of an array of them. - 6.0.0
Nodes no longer have a nonstandard
errorsarray, or araisemethod used to put things in that array. - 6.0.0
URL parsing and resolution was entirely overhauled to follow the URL standard!
- 6.0.0
Removed usage of the setimmediate library, as it required
evaland thus did not work in CSP scenarios.
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.