You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

isomorphic-dompurify

Package Overview
Dependencies
Maintainers
1
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

isomorphic-dompurify - npm Package Compare versions

Comparing version
3.0.0
to
3.1.0
+7
-7
package.json
{
"name": "isomorphic-dompurify",
"version": "3.0.0",
"version": "3.1.0",
"description": "Makes it possible to use DOMPurify on server and client in the same way.",

@@ -59,13 +59,13 @@ "keywords": [

"dependencies": {
"dompurify": "^3.3.1",
"jsdom": "^28.0.0"
"dompurify": "^3.3.2",
"jsdom": "^28.1.0"
},
"devDependencies": {
"@biomejs/biome": "^2.4.2",
"@types/jsdom": "^27.0.0",
"@biomejs/biome": "^2.4.6",
"@types/jsdom": "^28.0.0",
"@types/trusted-types": "^2.0.7",
"lefthook": "^2.1.1",
"lefthook": "^2.1.3",
"tsup": "^8.5.1",
"typescript": "^5.9.3",
"vitest": "^4.0.16"
"vitest": "^4.0.18"
},

@@ -72,0 +72,0 @@ "engines": {

@@ -5,4 +5,4 @@ # Isomorphic DOMPurify

The library makes it possible to seamlessly use [DOMPurify](https://github.com/cure53/DOMPurify) on server and client in the same way.
It does nothing by itself except providing an isomorphic/universal wrapper around DOMPurify, so all credits go to DOMPurify authors and contributors.
The library makes it possible to seamlessly use [DOMPurify](https://github.com/cure53/DOMPurify) on both server and client in the same way.
It does nothing by itself except for providing an isomorphic/universal wrapper around DOMPurify, so all credits go to DOMPurify authors and contributors.

@@ -15,5 +15,5 @@ > DOMPurify - a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks.

DOMPurify needs a DOM tree to base on, which is not available in Node by default. To work on the server side, we need a fake DOM to be created and supplied to DOMPurify. It means that DOMPurify initialization logic on the server is not the same as on the client.
DOMPurify needs a DOM tree to work with, which is not available in Node by default. To work on the server side, we need a fake DOM to be created and supplied to DOMPurify. It means that DOMPurify initialization logic on the server is not the same as on the client.
This project was born with the idea of encapsulating DOMPurify initialization details and providing an easy way to import the library on both, server and client, for example in Next.js apps.
This project was born with the idea of encapsulating DOMPurify initialization details and providing an easy way to import the library on both server and client, for example in Next.js apps.

@@ -42,3 +42,3 @@ It was inspired by [Isomorphic Unfetch](https://github.com/developit/unfetch/tree/master/packages/isomorphic-unfetch).

Please note that DOMPurify library [doesn't follow Semantic Versioning](https://github.com/cure53/DOMPurify/issues/446#issuecomment-643761433), so we have to release every change as a minor version because we cannot be 100% sure whether new features are added to patch DOMPurify releases or not.
Please note that the DOMPurify library [doesn't follow Semantic Versioning](https://github.com/cure53/DOMPurify/issues/446#issuecomment-643761433), so we have to release every change as a minor version because we cannot be 100% sure whether new features are added to patch DOMPurify releases or not.

@@ -53,3 +53,3 @@ ## Usage

You can pass [config](https://github.com/cure53/DOMPurify/blob/main/README.md) as a second argument:
You can pass the [config](https://github.com/cure53/DOMPurify/blob/main/README.md) as a second argument:
```javascript

@@ -93,2 +93,6 @@ const clean = DOMPurify.sanitize(dirtyString, { USE_PROFILES: { html: true } });

## Known Issues
- **ERR_REQUIRE_ESM in CommonJS environments (v3.0.0+):** `jsdom@28` pulls in an ESM-only dependency that breaks `require()` in environments like Next.js on Vercel. Workaround: pin `jsdom` to `25.0.1` via package manager overrides. See [#394](https://github.com/kkomelin/isomorphic-dompurify/issues/394).
## License

@@ -95,0 +99,0 @@