From 0bd593d5808aa9e80f6f7e75cb9a02819a9f43ee Mon Sep 17 00:00:00 2001 From: Konstantin Komelin Date: Thu, 28 Dec 2023 12:12:48 +0700 Subject: [PATCH] Recommended importing the entire module on client through Readme (refs #241). --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1940d57..57cb411 100644 --- a/README.md +++ b/README.md @@ -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