{"library":"isomorphic-dompurify","type":"library","category":null,"description":"isomorphic-dompurify provides a universal wrapper for the DOMPurify library, enabling its seamless use across both client-side browser environments and server-side Node.js applications. Its primary function is to abstract away the environment-specific initialization details required by DOMPurify, which necessitates a DOM tree to operate. On the server, it leverages `jsdom` to create a fake DOM environment, making the API identical to client-side usage. The package is currently at version 3.9.0 and experiences a regular release cadence, primarily driven by updates to its core dependency, DOMPurify, and other development dependencies. A key differentiator is its automatic handling of `jsdom` setup and teardown for server-side XSS sanitization, along with utilities for memory management in long-running Node.js processes. This library is crucial for applications built with frameworks like Next.js that require consistent sanitization logic irrespective of the rendering environment.","language":"javascript","status":"active","version":"3.9.0","tags":["javascript","security","dompurify","xss-filter","xss","isomorphic","wrapper","universal","ssr","typescript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install isomorphic-dompurify","imports":["import DOMPurify from 'isomorphic-dompurify';","import { sanitize } from 'isomorphic-dompurify';","import { clearWindow } from 'isomorphic-dompurify';"]},{"cmd":"yarn add isomorphic-dompurify","imports":[]},{"cmd":"pnpm add isomorphic-dompurify","imports":[]}],"homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/isomorphic-dompurify","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/isomorphic-dompurify/compatibility"}}