Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fabiospampinato/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.
https://github.com/fabiospampinato/amuchina
dom hands html sanitizer
Last synced: 2 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/fabiospampinato/amuchina
- Owner: fabiospampinato
- License: mit
- Created: 2022-07-24T00:40:02.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-04T21:48:48.000Z (10 months ago)
- Last Synced: 2024-11-09T02:08:45.038Z (3 months ago)
- Topics: dom, hands, html, sanitizer
- Language: TypeScript
- Homepage:
- Size: 57.6 KB
- Stars: 13
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# 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](https://wicg.github.io/sanitizer-api/), but it also supports SVG and MathML out of the box.
## Install
```sh
npm install --save amuchina
```## Usage
```ts
import Amuchina from 'amuchina';const amuchina = new Amuchina ();
const parser = new DOMParser ();const parse = ( html: string ) => parser.parseFromString ( html, 'text/html' );
amuchina.sanitize ( parse ( `` ) );
```## License
MIT © Fabio Spampinato