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

1.2.12 • 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

Dependents (2)

Package Sidebar

Install

npm i @jill64/universal-sanitizer

Weekly Downloads

5,806

Version

1.2.12

License

MIT

Unpacked Size

211 kB

Total Files

13

Last publish

Collaborators

  • jill64