@jill64/universal-sanitizer
TypeScript icon, indicating that this package has built-in type declarations

1.2.9Β β€’Β PublicΒ β€’Β Published

@jill64/universal-sanitizer

npm-version npm-license npm-download-month npm-min-size ci.yml

πŸ’Ž 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(/* ... */, {
  // options: {
  //   sanitizeHtml: sanitize-html options
  //   dompurify: DOMPurify options
  // }
})
condition resolve
browser DOMPurify
default sanitize-html
worker sanitize-html

License

MIT

Package Sidebar

Install

npm i @jill64/universal-sanitizer

Weekly Downloads

18,395

Version

1.2.9

License

MIT

Unpacked Size

211 kB

Total Files

13

Last publish

Collaborators

  • jill64