
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
universal-dompurify
Advanced tools
💎 Use DOMPurify for some context by conditional exports
npm i universal-dompurify
Conditional exports apply the appropriate DOMPurify file at each run.
import DOMPurify from 'universal-dompurify'
const cleaned = DOMPurify.sanitize(/* ... */)
condition | resolve |
---|---|
browser | DOMPurify |
default | DOMPurify + JSDOM |
worker | DOMPurify + JSDOM + (require: your external node polyfills) |
[!TIP] It is generally not recommended to use JSDOM with the restricted Edge runtime.
See also @jill64/universal-sanitizer for a more lightweight alternative.
Reduces bundle size by omitting rendering on the server.
/** @type {DOMPurify | null} */
import DOMPurify from 'universal-dompurify/browser-only'
const cleaned = DOMPurify?.sanitize?.(/* ... */) ?? 'server-fallback-value'
condition | resolve |
---|---|
browser | DOMPurify |
default | null |
worker | null |
FAQs
💎 Use DOMPurify for some context by conditional exports
The npm package universal-dompurify receives a total of 345 weekly downloads. As such, universal-dompurify popularity was classified as not popular.
We found that universal-dompurify demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.