@jill64/universal-sanitizer

đź’Ž Isomorphic html sanitizer by DOMPurify + sanitize-html
Installation
npm i @jill64/universal-sanitizer
Usage
Conditional Export applies the appropriate file at each runtime.
import { sanitize } from '@jill64/universal-sanitizer'
const cleaned = sanitize(, {
})
Add DOMPurify hook
The hook is executed before sanitize
import { sanitize } from '@jill64/universal-sanitizer'
const cleaned = sanitize(, {
options: {
hook: (DOMPurify) => {
DOMPurify.addHook(
'uponSanitizeAttribute',
function (currentNode, hookEvent, config) {
}
)
}
}
})
License
MIT