amuchina
TypeScript icon, indicating that this package has built-in type declarations

1.0.12 • Public • Published

Amuchina

A work-in-progress HTML sanitizer that strives for: performance like window.Sanitizer, readiness like DOMPurify, and ability to run in a WebWorker like neither of those.

This is basically an implementation of a subset of the upcoming Sanitizer API, but it also supports SVG and MathML out of the box.

Install

npm install --save amuchina

Usage

import Amuchina from 'amuchina';

const amuchina = new Amuchina ();
const parser = new DOMParser ();

const parse = ( html: string ) => parser.parseFromString ( html, 'text/html' );

amuchina.sanitize ( parse ( `<img src="/err" onerror="javascript:alert('naughty!')" />` ) );

License

MIT © Fabio Spampinato

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.12
    30
    • latest

Version History

Package Sidebar

Install

npm i amuchina

Weekly Downloads

30

Version

1.0.12

License

none

Unpacked Size

51.6 kB

Total Files

18

Last publish

Collaborators

  • fabiospampinato