Packages

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

Other targets from 5.6.1Latest31.0.1
  1. 5.6.1yours
  2. 6.0.0target
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

  1. 6.0.0

    Migration needed5 Aug 20154 new · 3 fixes
    • Breaking

      The potential breaking changes are highlighted in bold below; the largest ones are around the jsdom.env error-handling paradigm.

    • New

      Overhauled the named properties tracker to not walk the entire tree, thus greatly speeding up the setting of id and name attributes (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.compareDocumentPosition and anything that used it (like node.contains) by doing more intelligent tree traversal instead of directly implementing the specced algorithm.

8 other lines we could not sort, mostly version bumps
  • io.js 2.0 onward is now required, as we have begun using ES2015 features only present there.

    6.0.0
  • window.onerror (or window.addEventListener("error", ...)) now work, and will catch all script errors, similar to in browsers. This also introduces the ErrorEvent class, 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 by window.onerror; and not-implemented warnings resulting from calling methods like window.alert which jsdom explicitly does not support.

    6.0.0
  • The load(errors, window) callback was changed to onload(window), to reflect that it is now just sugar for setting a window.onload handler.

    6.0.0
  • The done(errors, window) callback (i.e., the default callback for jsdom.env) has become done(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 errors array, or a raise method 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 eval and thus did not work in CSP scenarios.

    6.0.0

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.