8 Best Node.js XSS Libraries

Curated by the Openbase team and community.Learn more

Curated by the Openbase team and community. Learn more

dom

dompurify

DOMPurify - a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks. Demo:

License Icon
License: (MPL-2.0 OR Apache-2.0)
TypeScript Icon
TypeScript Definitions: DefinitelyTyped
User Rating
5.0/ 5
1
Top Feedback
2Easy to Use
1Performant
GitHub Stars
8K
Weekly Downloads
2M
Last Commit
18d ago
Bundle Size (min+gzip)
N/A
Tree-Shakeable

x-xss-protection

Help secure Express apps with various HTTP headers

License Icon
License: MIT
TypeScript Icon
TypeScript Definitions: Built-In
User RatingN/A
Top Feedback
N/A
GitHub Stars
9K
Weekly Downloads
685K
Last Commit
1mo ago
Bundle Size (min+gzip)
0.22KB
Not Tree-Shakeable

xss-filters

Secure XSS Filters.

License Icon
License: Unknown
TypeScript Icon
TypeScript Definitions: DefinitelyTyped
User RatingN/A
Top Feedback
N/A
GitHub Stars
1K
Weekly Downloads
54K
Last Commit
5yrs ago
Bundle Size (min+gzip)
2.07KB
Not Tree-Shakeable
xc

xss-clean

Middleware to sanitize user input

License Icon
License: MIT
TypeScript Icon
TypeScript Definitions: DefinitelyTyped
User RatingN/A
Top Feedback
N/A
GitHub Stars
47
Weekly Downloads
13K
Last Commit
6yrs ago
Bundle Size (min+gzip)
2.32KB
Not Tree-Shakeable
ep

ember-purify

Purify your html content before marking it safe

License Icon
License: MIT
TypeScript Icon
TypeScript Definitions: DefinitelyTyped
User RatingN/A
Top Feedback
N/A
GitHub Stars
16
Weekly Downloads
8K
Last Commit
1yr ago
Bundle Size (min+gzip)
1.31KB
Not Tree-Shakeable

showdown-xss-filter

XSS filter for the Showdown markdown converter

License Icon
License: MIT
TypeScript Icon
TypeScript Definitions: DefinitelyTyped
User RatingN/A
Top Feedback
N/A
GitHub Stars
30
Weekly Downloads
8K
Last Commit
6yrs ago
Bundle Size (min+gzip)
5.21KB
Not Tree-Shakeable

secure-filters

Anti-XSS Security Filters for EJS and More

License Icon
License: BSD-3-Clause
TypeScript Icon
TypeScript Definitions: DefinitelyTyped
User RatingN/A
Top Feedback
N/A
GitHub Stars
135
Weekly Downloads
1K
Last Commit
5yrs ago
Bundle Size (min+gzip)
0.89KB
Not Tree-Shakeable
xss

xsslint

Find potential XSS vulnerabilities

License Icon
License: MIT
TypeScript Icon
TypeScript Definitions: DefinitelyTyped
User RatingN/A
Top Feedback
N/A
GitHub Stars
26
Weekly Downloads
345
Last Commit
2yrs ago
Bundle Size (min+gzip)
172.1KB
Not Tree-Shakeable