sanitize-html
Clean up user-submitted HTML, preserving allowlisted elements and allowlisted attributes on a per-element basis
sanitize-html@2.18.1 was published on 2026-10-14. Its manifest declares 6 runtime dependencies and 0 peer requirements. Bundled type declarations are not declared in the inspected metadata. The declared Node.js requirement is >=22.12.0.
All sanitize-html versions · Permanent reference to 2.18.1
Package specifications
| Version | 2.18.1 |
|---|---|
| License declaration | MIT |
| Published | 2026-10-14T18:15:44.574Z |
| Node.js requirement | >=22.12.0 |
| Type declarations | Not declared |
| Runtime dependency count | 6 |
| Peer requirement count | 0 |
| Optional dependency count | 0 |
| Minified size | 132.51 KiB |
| Minified + gzip | 49.09 KiB |
| Unpacked distribution size | 82.77 KiB |
| Published file count | 4 |
| Package type | Not declared |
| ES module entry | Not declared |
| Default entry | index.js |
| Side effects declaration | false |
| Direct advisories | 0 |
| Resolved graph dependencies | 15 |
| Repository stars | 4654 |
| Repository forks | 652 |
Install sanitize-html 2.18.1
npm install sanitize-html@2.18.1 pnpm add sanitize-html@2.18.1 yarn add sanitize-html@2.18.1
Runtime dependencies
- launder ^1.7.2
- postcss ^8.5.27
- htmlparser2 ^12.0.0
- parse-srcset ^1.0.2
- is-plain-object ^5.1.0
- escape-string-regexp ^4.0.0
Peer requirements
- None declared
Optional dependencies
- None declared
Resolved dependency graph
This deps.dev graph describes a generic 64-bit Linux environment, not your application lockfile.
- dayjs@1.11.23 — indirect
- dom-serializer@3.1.1 — indirect
- domelementtype@3.0.0 — indirect
- domhandler@6.0.1 — indirect
- domutils@4.0.2 — indirect
- entities@8.1.0 — indirect
- escape-string-regexp@4.0.0 — direct
- htmlparser2@12.0.0 — direct
- is-plain-object@5.1.0 — direct
- launder@1.7.2 — direct
- nanoid@3.3.20 — indirect
- parse-srcset@1.0.2 — direct
- picocolors@1.1.1 — indirect
- postcss@8.5.32 — direct
- source-map-js@1.2.2 — indirect
How to interpret the specifications
Bundlephobia measurements use its standard package build and may exclude peer dependencies. Unpacked npm distribution size includes shipped files and is a different measurement. Module declarations do not prove tree-shaking or runtime compatibility.
Advisories apply to this package version directly; transitive dependencies need separate inspection. Repository signals describe the whole repository and are current observations, including on historical-version pages.
OpenSSF repository checks
Provider assessment: 2026-08-24T00:00:00Z. These are repository checks, not a jsL maintenance score.
| Maintained | 10/10 — 30 commit(s) and 7 issue activity found in the last 90 days -- score normalized to 10 |
|---|---|
| Code-Review | 9/10 — Found 27/29 approved changesets -- score normalized to 9 |
| CII-Best-Practices | 0/10 — no effort to earn an OpenSSF best practices badge detected |
| Dangerous-Workflow | 10/10 — no dangerous workflow patterns detected |
| Token-Permissions | 0/10 — detected GitHub workflow tokens with excessive permissions |
| License | 0/10 — license file not detected |
| Security-Policy | 9/10 — security policy file detected |
| Binary-Artifacts | 10/10 — no binaries found in the repo |
| Pinned-Dependencies | 0/10 — dependency not pinned by hash detected -- score normalized to 0 |
| SAST | 9/10 — SAST tool is not run on all commits -- score normalized to 9 |
| Fuzzing | 0/10 — project is not fuzzed |
Evidence and freshness
- https://registry.npmjs.org/sanitize-html/2.18.1 — retrieved 2026-10-29T09:32:02.850Z
- https://bundlephobia.com/api/size?package=sanitize-html%402.18.1 — retrieved 2026-10-29T09:32:03.342Z
- https://api.deps.dev/v3/systems/npm/packages/sanitize-html/versions/2.18.1 — retrieved 2026-10-29T09:32:03.355Z
- https://api.deps.dev/v3/systems/npm/packages/sanitize-html/versions/2.18.1:dependencies — retrieved 2026-10-29T09:32:03.366Z
- https://api.deps.dev/v3/projects/github.com%2Fapostrophecms%2Fapostrophe — retrieved 2026-10-29T09:32:03.505Z