Skip to content

Commit

Permalink
Simplified the Usage section of the Readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
kkomelin committed Dec 20, 2023
1 parent cc6dcd4 commit 1c78ffd
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,14 @@ Please note that DOMPurify library [doesn't follow Semantic Versioning](https://

## Usage

1. Import the library:

```javascript
// Import a necessary function in the ES6 way (recommended):
import { sanitize, isSupported } from "isomorphic-dompurify";

// or the entire module:
import DOMPurify from 'isomorphic-dompurify';

// or as a CommonJS module:
const DOMPurify = require('isomorphic-dompurify');
// Import:
import { sanitize } from "isomorphic-dompurify";
```

2. Sanitize a string:

```javascript
const clean = DOMPurify.sanitize(dirty);
// Sanitize:
const clean = sanitize(dirtyString);
```

## Known Issues
Expand Down

0 comments on commit 1c78ffd

Please sign in to comment.