NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm
npm, #4438 most downloaded on npm
Makes it possible to use DOMPurify on server and client in the same way.
Latest stable
4.7.0
Last release 19 days ago
07 Nov 2026
Ships fairly regularly
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
116 releases · first in 2020
Drag across the ruler to compare, or tap a release to open it.
Note: jsdom 31 is a major release, but its breaking changes (async parsing at blocking scripts, new CSS engine, @napi-rs/canvas backend) don't affect…
Note: jsdom 31 is a major release, but its breaking changes (async parsing at blocking scripts, new CSS engine, @napi-rs/canvas backend) don't affect isomorphic-dompurify, which sanitizes in a script-free <!DOCTYPE html> window. It fixes <template> parsing and serialization in XML documents, which can change output when sanitizing with PARSER_MEDIA_TYPE: 'application/xhtml+xml'.
Removed the ignoreDeprecations workaround from tsconfig (no longer needed with tsup 9)
Your coding agent can read these notes before it upgrades. Set up the MCP server →
ignoreDeprecations workaround from tsconfig (no longer needed with tsup 9)Note: DOMPurify 3.4.17 fixes IN_PLACE handling with shadow roots and hooks, the SMIL attributeName guard in XHTML mode, and hardens several smaller edge cases.
dompurify range pinned to ^3.4.16
- dompurify 3.4.15 -> 3.4.16 - jsdom 30.1.0 -> 30.1.1
@biomejs/biome 2.5.12 -> 2.5.14 (dev)
Note: jsdom 30.1.0 improves resource consumption - clearWindow() now returns the heap fully to baseline (previously ~1.7 MB residual per clear cycle).
@biomejs/biome 2.5.11 -> 2.5.12 (dev)
README Requirements table: the raised Node.js floor is now listed under >=4.0.0 (was >=3.20.0)
>=4.0.0 (was >=3.20.0)v3.20.0 raised the minimum Node.js version (inherited from jsdom 30) - a breaking change that should have been a major release. 4.0.0 corrects that: t…
This is a major version bump with no functional code changes relative to 3.23.0.
v3.20.0 raised the minimum Node.js version (inherited from jsdom 30) - a breaking change that should have been a major release. 4.0.0 corrects that: the same code as 3.23.0, now on a proper major so ^3.x consumers are not silently upgraded onto a build that dropped their Node.js version.
^22.22.2 || ^24.15.0 || >=26.0.0 (Node 20 no longer supported)node20 dist-tag)- dompurify 3.4.13 -> 3.4.14 - vitest 4.1.10 -> 4.1.11 - @biomejs/biome 2.5.7 -> 2.5.10 - @types/jsdom 28.0.3 -> 30.0.0 - pnpm 11.20.0 -> 11.23.0
- dompurify 3.4.12 -> 3.4.13 - @biomejs/biome 2.5.6 -> 2.5.7 - pnpm 11.17.0 -> 11.20.0
- jsdom 30.0.0 -> 30.0.1 - @biomejs/biome 2.5.5 -> 2.5.6
Node.js requirement raised to ^22.22.2 || ^24.15.0 || >=26.0.0 (Node 20 is no longer supported)
^22.22.2 || ^24.15.0 || >=26.0.0 (Node 20 is no longer supported)pnpm/action-setup 6.0.8 -> 6.0.9
- dompurify 3.4.10 -> 3.4.11 - vitest 4.1.8 -> 4.1.9 - pnpm/action-setup 6 -> 6.0.8
- dompurify 3.4.8 -> 3.4.10 - @biomejs/biome 2.4.16 -> 2.5.0 - pnpm 11.4.0 -> 11.6.0
- dompurify 3.4.7 -> 3.4.8 - vitest 4.1.7 -> 4.1.8 - lefthook 2.1.8 -> 2.1.9
@biomejs/biome 2.4.15 -> 2.4.16
chore(deps): bump dompurify from 3.4.3 to 3.4.5 by @dependabot[bot]
Full Changelog: https://github.com/kkomelin/isomorphic-dompurify/compare/3.13.0...3.14.0
chore(deps-dev): bump vitest from 4.1.5 to 4.1.6 by @dependabot[bot] in https://github.com/kkomelin/isomorphic-dompurify/pull/435
Full Changelog: https://github.com/kkomelin/isomorphic-dompurify/compare/3.12.0...3.13.0
chore(deps): bump dompurify from 3.4.1 to 3.4.2 by @dependabot[bot] in https://github.com/kkomelin/isomorphic-dompurify/pull/430
Full Changelog: https://github.com/kkomelin/isomorphic-dompurify/compare/3.11.0...3.12.0
chore(deps-dev): bump @biomejs/biome from 2.4.12 to 2.4.13 by @dependabot[bot] in https://github.com/kkomelin/isomorphic-dompurify/pull/426
Full Changelog: https://github.com/kkomelin/isomorphic-dompurify/compare/3.10.0...3.11.0
chore(deps-dev): bump lefthook from 2.1.5 to 2.1.6 by @dependabot[bot] in https://github.com/kkomelin/isomorphic-dompurify/pull/422
Full Changelog: https://github.com/kkomelin/isomorphic-dompurify/compare/3.9.0...3.10.0
Updated dev dependencies (Biome, Vitest)
Full Changelog: https://github.com/kkomelin/isomorphic-dompurify/compare/3.8.0...3.9.0
bump jsdom from 29.0.1 to 29.0.2
Dependency updates:
Fixed missing browser type declarations — browser.d.ts and browser.d.mts were not included in the 3.7.0 published package due to a race condition in t
browser.d.ts and browser.d.mts were not included in the 3.7.0 published package due to a race condition in the build process. This caused TS7016: Could not find a declaration file for module 'isomorphic-dompurify' errors in tsgo and TypeScript 6 when resolving through the default (browser) exports condition. (#411)Thanks to @asterikx and @ElPrudi for their help with the issue.
Silence baseUrl deprecation warning from tsup dts build in TS6
TypeScript 6 compatibility fixes:
Dependency updates:
bump jsdom from 29.0.0 to 29.0.1
Dependency updates:
Fix outdated build artifacts published in 3.5.0.
Fix outdated build artifacts published in 3.5.0.
The default export is now callable as a factory function, matching the dompurify API — DOMPurify(window) now returns a new DOMPurify instance bound to
dompurify API — DOMPurify(window) now returns a new DOMPurify instance bound to the given window (#405)isEqualNode returning false when comparing RETURN_DOM + FORCE_BODY output against nodes from a separate JSDOM context (#405)Thanks to @probablykasper for helping with this release.
Upgraded jsdom from 28 to 29, which fixes performance degradation in long-running processes; note that heap memory still grows over time without calli
clearWindow()format script (biome format --write) and pre-commit hook## What's Changed Full Changelog: https://github.com/kkomelin/isomorphic-dompurify/compare/3.2.0...3.3.0
Full Changelog: https://github.com/kkomelin/isomorphic-dompurify/compare/3.2.0...3.3.0
chore(deps): bump dompurify from 3.3.2 to 3.3.3
Full Changelog: https://github.com/kkomelin/isomorphic-dompurify/compare/3.1.0...3.2.0
chore(deps-dev): bump @types/jsdom from 27.0.0 to 28.0.0 by @dependabot[bot] in https://github.com/kkomelin/isomorphic-dompurify/pull/396
Full Changelog: https://github.com/kkomelin/isomorphic-dompurify/compare/3.0.0...3.1.0
The library now ships proper ESM alongside CommonJS. Both import and require work out of the box with correct module resolution.
The library now ships proper ESM alongside CommonJS. Both import and require work out of the box with correct module resolution.
// ESM — now works natively
import DOMPurify, { sanitize } from "isomorphic-dompurify";
// CJS — still works
const DOMPurify = require("isomorphic-dompurify");
New clearWindow() export that closes the internal jsdom window and creates a fresh one, preventing unbounded memory growth and progressive slowdown in long-running Node.js processes (#368).
import { sanitize, clearWindow } from "isomorphic-dompurify";
// Call clearWindow() when you want to release accumulated DOM state,
// e.g. periodically, after a batch, or per-request in a server:
app.use((req, res, next) => {
res.on("finish", () => clearWindow());
next();
});
Note: clearWindow() is a no-op in the browser build (no jsdom to manage). Any hooks or config set via addHook/setConfig will need to be re-applied after calling it.
sanitize, addHook, removeHook, removeHooks, removeAllHooks, setConfig, clearConfig, isValidAttribute, isSupported, version, and removed are all exported directly.global.DOMPurify singleton removed. The library no longer writes to global.DOMPurify. Module caching provides singleton behavior in both ESM and CJS. This also fixes a security concern where malicious code could preempt the global before the module loaded (#324).dist/. Entry points are now dist/index.js (CJS), dist/index.mjs (ESM), dist/browser.js (CJS), dist/browser.mjs (ESM). The exports map handles this automatically — no changes needed for consumers using standard imports.index.d.ts using export = DOMPurify is replaced by generated .d.ts and .d.mts files with proper export default and named exports.^20.19.0 || ^22.12.0 || >=24.0.0 to match jsdom 28's requirements. Node 21.x, 23.x, and 22.0–22.11 are no longer supported.global.DOMPurifylru-cache ESM resolution errors in Nuxt/Nitro buildscreateWindow TypeError in Next.js 15 (jsdom is now external, reducing bundler conflicts)webidl-conversions error in Node.js 22 + Next.jscanvas resolution error in serverless environmentsactions/checkout@v4, actions/setup-node@v4, pnpm/action-setup@v4chore(deps): bump jsdom from 28.0.0 to 28.1.0
Full Changelog: https://github.com/kkomelin/isomorphic-dompurify/compare/v3.0.0-rc.2...v3.0.0-rc.3
New clearWindow() export that closes the internal jsdom window and creates a fresh one, preventing unbounded memory growth and progressive slowdown in
New clearWindow() export that closes the internal jsdom window and creates a fresh one, preventing unbounded memory growth and progressive slowdown in long-running Node.js processes (#368).
import { sanitize, clearWindow } from "isomorphic-dompurify";
// Call clearWindow() when you want to release accumulated DOM state,
// e.g. periodically, after a batch, or per-request in a server:
app.use((req, res, next) => {
res.on("finish", () => clearWindow());
next();
});
Note: clearWindow() is a no-op in the browser build (no jsdom to manage). Any hooks or config set via addHook/setConfig will need to be re-applied after calling it.
The library now ships proper ESM alongside CommonJS. Both import and require work out of the box with correct module resolution.
// ESM — now works natively
import DOMPurify, { sanitize } from "isomorphic-dompurify";
// CJS — still works
const DOMPurify = require("isomorphic-dompurify");
sanitize, addHook, removeHook, removeHooks, removeAllHooks, setConfig, clearConfig, isValidAttribute, isSupported, version, and removed are all exported directly.global.DOMPurify singleton removed. The library no longer writes to global.DOMPurify. Module caching provides singleton behavior in both ESM and CJS. This also fixes a security concern where malicious code could preempt the global before the module loaded (#324).dist/. Entry points are now dist/index.js (CJS), dist/index.mjs (ESM), dist/browser.js (CJS), dist/browser.mjs (ESM). The exports map handles this automatically — no changes needed for consumers using standard imports.index.d.ts using export = DOMPurify is replaced by generated .d.ts and .d.mts files with proper export default and named exports.^20.19.0 || ^22.12.0 || >=24.0.0 to match jsdom 28's requirements. Node 21.x, 23.x, and 22.0–22.11 are no longer allowed.global.DOMPurifylru-cache ESM resolution errors in Nuxt/Nitro buildscreateWindow TypeError in Next.js 15 (jsdom is now external, reducing bundler conflicts)webidl-conversions error in Node.js 22 + Next.jscanvas resolution error in serverless environmentsactions/checkout@v4, actions/setup-node@v4, pnpm/action-setup@v4The library now ships proper ESM alongside CommonJS. Both import and require work out of the box with correct module resolution.
The library now ships proper ESM alongside CommonJS. Both import and require work out of the box with correct module resolution.
// ESM — now works natively
import DOMPurify, { sanitize } from "isomorphic-dompurify";
// CJS — still works
const DOMPurify = require("isomorphic-dompurify");
sanitize, addHook, removeHook, removeHooks, removeAllHooks, setConfig, clearConfig, isValidAttribute, isSupported, version, and removed are all exported directly.global.DOMPurify singleton removed. The library no longer writes to global.DOMPurify. Module caching provides singleton behavior in both ESM and CJS. This also fixes a security concern where malicious code could preempt the global before the module loaded (#324).dist/. Entry points are now dist/index.js (CJS), dist/index.mjs (ESM), dist/browser.js (CJS), dist/browser.mjs (ESM). The exports map handles this automatically — no changes needed for consumers using standard imports.index.d.ts using export = DOMPurify is replaced by generated .d.ts and .d.mts files with proper export default and named exports.^20.19.0 || ^22.12.0 || >=24.0.0 to match jsdom 28's requirements. Node 21.x, 23.x, and 22.0–22.11 are no longer allowed.global.DOMPurifylru-cache ESM resolution errors in Nuxt/Nitro buildscreateWindow TypeError in Next.js 15 (jsdom is now external, reducing bundler conflicts)webidl-conversions error in Node.js 22 + Next.jscanvas resolution error in serverless environmentsactions/checkout@v4, actions/setup-node@v4, pnpm/action-setup@v4See the complete changelog for more details.
See the complete changelog for more details.
jsdom.See the complete changelog for more details.
[x] Updated dompurify and jsdom.
dompurify and jsdom.See the complete changelog for more details.
[x] Improved Web Worker compatibility (partial) #242 (thanks @wSedlacek for the contribution and @coderabbitai for advice)
See the complete changelog for more details.
See the complete changelog for more details.
jsdom.See the complete changelog for more details.
See the complete changelog for more details.
jsdom.See the complete changelog for more details.
This release drops support for Node < 20.19.5, so please update your Node accordingly. Node 22 and 24 may need upgrade too if you're affected - read c
This release drops support for Node < 20.19.5, so please update your Node accordingly. Node 22 and 24 may need upgrade too if you're affected - read comments here https://github.com/jsdom/jsdom/pull/3963
See the complete changelog for more details.
This release drops support for Node < 20.19.5, so please update your Node accordingly.
This release drops support for Node < 20.19.5, so please update your Node accordingly.
jsdom.See the complete changelog for more details.
See the complete changelog for more details.
See the complete changelog for more details.
[x] Updated jsdom which dropped support for Node < 20.
jsdom which dropped support for Node < 20.See the complete changelog for more details.
[x] Added proper exports field to the package settigns (#348) It potentially also resolved #347 #228 #214 https://github.com/vercel/next.js/discussion
See the complete changelog for more details.
[x] Updated dompurify and other dependencies.
dompurify and other dependencies.See the complete changelog for more details.
[x] Updated jsdom and other dependencies.
jsdom and other dependencies.See the complete changelog for more details.
[x] Updated other dependencies.
dompurify.See the complete changelog for more details.
[x] Updated dompurify. Thanks to @NicholasEllul for providing a PR, @hendra-widjaja and @RostyslavManko for reporting the issue.
dompurify. Thanks to @NicholasEllul for providing a PR, @hendra-widjaja and @RostyslavManko for reporting the issue.See the complete changelog for more details.
[x] Updated dompurify and others.
See the complete changelog for more details.
[x] Updated dompurify and other dependencies.
dompurify and other dependencies.See the complete changelog for more details.
[x] Updated dompurify and other dependencies.
dompurify and other dependencies.See the complete changelog for more details.
[x] Removed @types/dompurify dependency which caused an issue https://github.com/kkomelin/isomorphic-dompurify/issues/301. The third-party types are n
@types/dompurify dependency which caused an issue https://github.com/kkomelin/isomorphic-dompurify/issues/301. The third-party types are not needed anymore because dompurify provides their own. Thanks to @Bro3Simon for helping with it.dompurify and other dependencies.See the complete changelog for more details.
[x] Updated dompurify, jsdom and other dependencies.
dompurify, jsdom and other dependencies.See the complete changelog for more details.
[x] Updated jsdom and other dependencies.
jsdom and other dependencies.See the complete changelog for more details.
One column per quarter.