https://github.com/un-ts/domiso
The smallest and fastest DOM sanitizer based on browser native DOMParser
https://github.com/un-ts/domiso
dom-parser dom-sanitizer html-sanitizer sanitizer sanity web-security
Last synced: 4 months ago
JSON representation
The smallest and fastest DOM sanitizer based on browser native DOMParser
- Host: GitHub
- URL: https://github.com/un-ts/domiso
- Owner: un-ts
- License: mit
- Created: 2022-07-27T12:17:49.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-05-29T06:15:38.000Z (4 months ago)
- Last Synced: 2025-06-02T11:19:24.195Z (4 months ago)
- Topics: dom-parser, dom-sanitizer, html-sanitizer, sanitizer, sanity, web-security
- Language: TypeScript
- Homepage: https://domiso.js.org
- Size: 379 KB
- Stars: 6
- Watchers: 0
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# domiso
[](https://github.com/un-ts/domiso/actions/workflows/ci.yml)
[](https://codecov.io/gh/un-ts/domiso)
[](https://github.com/plantain-00/type-coverage)
[](https://www.npmjs.com/package/domiso)
[](https://github.com/un-ts/domiso/releases)[](https://conventionalcommits.org)
[](https://renovatebot.com)
[](https://standardjs.com)
[](https://github.com/prettier/prettier)
[](https://github.com/atlassian/changesets)The smallest and fastest DOM sanitizer based on browser native DOMParser
## TOC
- [Usage](#usage)
- [Install](#install)
- [API](#api)
- [Sponsors](#sponsors)
- [Backers](#backers)
- [Changelog](#changelog)
- [License](#license)## Usage
### Install
```sh
# pnpm
pnpm add domiso# yarn
yarn add domiso# npm
npm i domiso
```### API
```js
import { IMAGE_SVG_XML, sanitize, sanitizeSvg } from 'domiso'sanitize(``)
sanitize(`SVG content`, IMAGE_SVG_XML)
sanitizeSvg(`SVG content`)
```## Sponsors
| 1stG | RxTS | UnTS |
| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| [](https://opencollective.com/1stG) | [](https://opencollective.com/rxts) | [](https://opencollective.com/unts) |## Backers
[](https://github.com/sponsors/JounQin)
| 1stG | RxTS | UnTS |
| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| [](https://opencollective.com/1stG) | [](https://opencollective.com/rxts) | [](https://opencollective.com/unts) |## Changelog
Detailed changes for each release are documented in [CHANGELOG.md](./CHANGELOG.md).
## License
[MIT][] © [JounQin][]@[1stG.me][]
[1stg.me]: https://www.1stg.me
[jounqin]: https://GitHub.com/JounQin
[mit]: http://opensource.org/licenses/MIT