Skip to content

Commit

Permalink
Recommended importing the entire module on client through Readme (refs
Browse files Browse the repository at this point in the history
  • Loading branch information
kkomelin committed Dec 28, 2023
1 parent 5e5ca7e commit 0bd593d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,17 @@ Please note that DOMPurify library [doesn't follow Semantic Versioning](https://

Import:
```javascript
import { sanitize } from "isomorphic-dompurify";
import DOMPurify from "isomorphic-dompurify";
```
_Importing the entire module for the client/browser version is recommended._

Sanitize:
```javascript
const clean = sanitize(dirtyString);
const clean = DOMPurify.sanitize(dirtyString);
```
or with [config](https://github.com/cure53/DOMPurify/blob/main/README.md):
```javascript
const clean = sanitize(dirtyString, { USE_PROFILES: { html: true } });
const clean = DOMPurify.sanitize(dirtyString, { USE_PROFILES: { html: true } });
```

## Known Issues
Expand Down

0 comments on commit 0bd593d

Please sign in to comment.