# leizongmin/js-xss

Sanitize untrusted HTML (to prevent XSS) with a configuration specified by a Whitelist

Repository: https://github.com/leizongmin/js-xss
Canonical: https://ross.abutalabs.com/products/js-xss
Homepage: http://jsxss.com
Language: HTML
License: NOASSERTION
License Family: other
Last push: 2026-05-06T11:36:47+00:00

## Health v2 (maintenance only)
Score: 69/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 81, release rhythm 35, longevity 100
- inputs: {"age_days": 5097, "days_push": 119, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 5313, forks 635 (observed 2026-08-28T04:09:15.481381+00:00)

## What it is
A JavaScript library for sanitizing untrusted HTML to prevent XSS attacks using a configurable whitelist of allowed tags and attributes. It works in Node.js and browsers and supports custom filtering functions.

## Use cases
- sanitize user-submitted HTML comments
- prevent XSS attacks in web apps
- filter HTML input with a whitelist
- strip script tags from rich text
- clean untrusted HTML before rendering

## When to choose
- you need whitelist-based HTML sanitization in Node.js or the browser
- you want fast, battle-tested XSS filtering with custom tag/attribute handling

## When to avoid
- you need to sanitize non-HTML content like Markdown or CSS
- you need a full DOM parser or HTML rewriting beyond filtering

## Facets
- artifact type: library
- maturity: stable
- function: security, serialization, web-framework
- domain: security, web-development, backend
- platform: browser
- tags: xss, html-sanitizer, whitelist, input-filtering, npm, nodejs, javascript

## Member repositories
- leizongmin/js-xss (main) score 69

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:15.481381+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:58:58.151564+00:00, confidence not recorded.
  - readme: https://github.com/leizongmin/js-xss (fetched 2026-08-28T04:09:15.481381+00:00, sha 2cf6c82fddbf)
  - homepage: http://jsxss.com (fetched 2026-08-29T08:53:40.980671+00:00, sha 20e213006677)
- Data as of 2026-08-30T08:39:29.467469+00:00.
