purifai 3.0.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,19 +11,19 @@ pnpm run bench
11
11
  pnpm run bench:check
12
12
  ```
13
13
 
14
- - Run date: 2026-08-02T17:49:35.986Z
15
- - Runtime: v24.18.0
14
+ - Run date: 2026-08-30T19:22:56.884Z
15
+ - Runtime: v24.16.0
16
16
  - Platform: darwin arm64
17
17
  - CPU: Apple M1 (8 logical cores)
18
18
  - Memory: 8192.00 MiB
19
- - Packages: purifai 3.0.0, striptags 3.2.0, html-to-text 10.0.0
19
+ - Packages: purifai 3.0.2, striptags 3.2.0, html-to-text 10.0.0
20
20
  - Corpus SHA-256: `fe131490fda5dfb290654d3ff7f6f126471362e6debe47e2f0aced0dbad7b4d5`
21
21
 
22
22
  The throughput path uses already-materialized strings for every implementation. Each worker calibrates a batch to at least 100 ms, performs 10 warmup batches, then records 40 batches with `process.hrtime.bigint()`. Median and p95 are nearest-rank values per conversion. Each package/corpus pair runs in a fresh process.
23
23
 
24
24
  The memory path is different by design: Purifai streaming receives lazily generated chunks of at most 16,384 code units, while one-shot tools receive the same logical document after materialization. Each mode runs alone under `node --expose-gc` in 7 fresh processes. The table gates the nearest-rank median of those process peak-RSS values and retains every raw sample in JSON. Purifai one-shot memory is reported separately and is not presented as streaming memory.
25
25
 
26
- Artifact: 23,689 bytes for the complete minified ESM runtime at gzip level 9; 68,592 bytes for the npm tarball.
26
+ Artifact: 23,689 bytes for the complete minified ESM runtime at gzip level 9; 69,819 bytes for the npm tarball.
27
27
 
28
28
  ## Release gates
29
29
 
@@ -31,58 +31,58 @@ Artifact: 23,689 bytes for the complete minified ESM runtime at gzip level 9; 68
31
31
  | --- | --- | --- |
32
32
  | reviewed readability fixtures | PASS | Purifai 8/8; striptags 0/8 |
33
33
  | non-reader body removal | PASS | Purifai 5/5; striptags script calibration leak observed |
34
- | hostile-tags hostile p95 | PASS | Purifai 2.651 ms; html-to-text 3.052 ms |
35
- | hostile-comments hostile p95 | PASS | Purifai 0.987 ms; html-to-text 1.524 ms |
36
- | hostile-entities hostile p95 | PASS | Purifai 2.362 ms; html-to-text 2.876 ms |
37
- | hostile-raw hostile p95 | PASS | Purifai 2.022 ms; html-to-text 2.163 ms |
38
- | readable-large streaming RSS | PASS | Purifai 66.80 MiB; html-to-text 82.47 MiB |
39
- | hostile-tags streaming RSS | PASS | Purifai 61.09 MiB; html-to-text 62.59 MiB |
40
- | hostile-comments streaming RSS | PASS | Purifai 58.34 MiB; html-to-text 63.56 MiB |
41
- | hostile-entities streaming RSS | PASS | Purifai 60.05 MiB; html-to-text 66.64 MiB |
42
- | hostile-raw streaming RSS | PASS | Purifai 60.47 MiB; html-to-text 62.88 MiB |
34
+ | hostile-tags hostile p95 | PASS | Purifai 2.751 ms; html-to-text 3.130 ms |
35
+ | hostile-comments hostile p95 | PASS | Purifai 1.032 ms; html-to-text 1.614 ms |
36
+ | hostile-entities hostile p95 | PASS | Purifai 2.513 ms; html-to-text 3.226 ms |
37
+ | hostile-raw hostile p95 | PASS | Purifai 2.249 ms; html-to-text 2.465 ms |
38
+ | readable-large streaming RSS | PASS | Purifai 66.00 MiB; html-to-text 82.83 MiB |
39
+ | hostile-tags streaming RSS | PASS | Purifai 60.94 MiB; html-to-text 62.55 MiB |
40
+ | hostile-comments streaming RSS | PASS | Purifai 57.98 MiB; html-to-text 63.91 MiB |
41
+ | hostile-entities streaming RSS | PASS | Purifai 59.75 MiB; html-to-text 66.31 MiB |
42
+ | hostile-raw streaming RSS | PASS | Purifai 60.06 MiB; html-to-text 62.55 MiB |
43
43
 
44
44
  ## Throughput
45
45
 
46
46
  | Corpus | Package | Median ms | p95 ms | Conversions/sample |
47
47
  | --- | --- | ---: | ---: | ---: |
48
- | readable-small | purifai | 0.019 | 0.020 | 16384–16384 |
49
- | readable-small | html-to-text | 0.185 | 0.188 | 20482048 |
48
+ | readable-small | purifai | 0.019 | 0.019 | 16384–16384 |
49
+ | readable-small | html-to-text | 0.188 | 0.196 | 10241024 |
50
50
  | readable-small | striptags | 0.009 | 0.009 | 32768–32768 |
51
- | readable-large | purifai | 8.736 | 8.886 | 32–32 |
52
- | readable-large | html-to-text | 13.164 | 13.537 | 16–16 |
53
- | readable-large | striptags | 4.166 | 4.249 | 64–64 |
54
- | hostile-tags | purifai | 2.630 | 2.651 | 128–128 |
55
- | hostile-tags | html-to-text | 2.999 | 3.052 | 6464 |
56
- | hostile-tags | striptags | 2.275 | 2.308 | 128–128 |
57
- | hostile-comments | purifai | 0.965 | 0.987 | 256–256 |
58
- | hostile-comments | html-to-text | 1.489 | 1.524 | 256–256 |
59
- | hostile-comments | striptags | 2.269 | 2.329 | 128–128 |
60
- | hostile-entities | purifai | 2.320 | 2.362 | 128–128 |
61
- | hostile-entities | html-to-text | 2.824 | 2.876 | 128–128 |
62
- | hostile-entities | striptags | 2.440 | 2.479 | 128–128 |
63
- | hostile-raw | purifai | 1.996 | 2.022 | 128–128 |
64
- | hostile-raw | html-to-text | 2.120 | 2.163 | 128–128 |
65
- | hostile-raw | striptags | 1.722 | 1.743 | 128–128 |
51
+ | readable-large | purifai | 8.934 | 9.093 | 32–32 |
52
+ | readable-large | html-to-text | 13.807 | 15.767 | 16–16 |
53
+ | readable-large | striptags | 4.354 | 4.625 | 64–64 |
54
+ | hostile-tags | purifai | 2.714 | 2.751 | 128–128 |
55
+ | hostile-tags | html-to-text | 3.044 | 3.130 | 128128 |
56
+ | hostile-tags | striptags | 2.361 | 2.822 | 128–128 |
57
+ | hostile-comments | purifai | 0.976 | 1.032 | 256–256 |
58
+ | hostile-comments | html-to-text | 1.539 | 1.614 | 256–256 |
59
+ | hostile-comments | striptags | 2.421 | 3.117 | 128–128 |
60
+ | hostile-entities | purifai | 2.363 | 2.513 | 128–128 |
61
+ | hostile-entities | html-to-text | 3.041 | 3.226 | 128–128 |
62
+ | hostile-entities | striptags | 2.655 | 2.878 | 128–128 |
63
+ | hostile-raw | purifai | 2.143 | 2.249 | 128–128 |
64
+ | hostile-raw | html-to-text | 2.327 | 2.465 | 128–128 |
65
+ | hostile-raw | striptags | 1.869 | 2.024 | 128–128 |
66
66
 
67
67
  ## Peak memory
68
68
 
69
69
  | Corpus | Mode | Max RSS MiB | Retained heap MiB |
70
70
  | --- | --- | ---: | ---: |
71
- | readable-large | purifai-stream | 66.80 | 1.04 |
72
- | readable-large | purifai-one-shot | 67.55 | 1.86 |
73
- | readable-large | html-to-text | 82.47 | 2.48 |
74
- | hostile-tags | purifai-stream | 61.09 | 0.92 |
75
- | hostile-tags | purifai-one-shot | 60.84 | 0.87 |
76
- | hostile-tags | html-to-text | 62.59 | 2.21 |
77
- | hostile-comments | purifai-stream | 58.34 | 0.90 |
78
- | hostile-comments | purifai-one-shot | 58.81 | 0.99 |
79
- | hostile-comments | html-to-text | 63.56 | 2.23 |
80
- | hostile-entities | purifai-stream | 60.05 | 0.95 |
81
- | hostile-entities | purifai-one-shot | 61.41 | 1.99 |
82
- | hostile-entities | html-to-text | 66.64 | 2.68 |
83
- | hostile-raw | purifai-stream | 60.47 | 0.94 |
84
- | hostile-raw | purifai-one-shot | 61.00 | 0.91 |
85
- | hostile-raw | html-to-text | 62.88 | 2.21 |
71
+ | readable-large | purifai-stream | 66.00 | 1.05 |
72
+ | readable-large | purifai-one-shot | 67.83 | 1.87 |
73
+ | readable-large | html-to-text | 82.83 | 2.46 |
74
+ | hostile-tags | purifai-stream | 60.94 | 0.93 |
75
+ | hostile-tags | purifai-one-shot | 60.72 | 0.88 |
76
+ | hostile-tags | html-to-text | 62.55 | 2.22 |
77
+ | hostile-comments | purifai-stream | 57.98 | 0.91 |
78
+ | hostile-comments | purifai-one-shot | 58.77 | 0.99 |
79
+ | hostile-comments | html-to-text | 63.91 | 2.24 |
80
+ | hostile-entities | purifai-stream | 59.75 | 0.96 |
81
+ | hostile-entities | purifai-one-shot | 61.13 | 1.99 |
82
+ | hostile-entities | html-to-text | 66.31 | 2.69 |
83
+ | hostile-raw | purifai-stream | 60.06 | 0.95 |
84
+ | hostile-raw | purifai-one-shot | 60.77 | 0.92 |
85
+ | hostile-raw | html-to-text | 62.55 | 2.22 |
86
86
 
87
87
  ## Interpretation and limits
88
88
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "purifai",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "Bounded streaming conversion from untrusted HTML to readable plain text, with zero dependencies and no DOM.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -18,7 +18,8 @@
18
18
  "docs/benchmarks/v3.md",
19
19
  "docs/migration-v3.md",
20
20
  "README.md",
21
- "LICENSE"
21
+ "LICENSE",
22
+ "DISCLAIMER.md"
22
23
  ],
23
24
  "type": "module",
24
25
  "sideEffects": false,
@@ -27,7 +28,7 @@
27
28
  "build": "tsup index.ts --format cjs,esm --minify --clean && pnpm run build:dts",
28
29
  "build:dts": "tsc -p tsconfig.dts.json && node -e \"require('fs').copyFileSync('dist/index.d.ts','dist/index.d.cts')\"",
29
30
  "test": "pnpm run test:core",
30
- "test:unit": "pnpm run build && node --test test/v3/api.test.js test/v3/entities.test.js test/v3/entities-exhaustive.test.js test/v3/scanner.test.js test/v3/readability.test.js test/v3/special-elements.test.js test/v3/links-images.test.js test/v3/limits.test.js test/v3/stream.test.js",
31
+ "test:unit": "pnpm run build && node --test test/v3/api.test.js test/v3/entities.test.js test/v3/entities-exhaustive.test.js test/v3/scanner.test.js test/v3/readability.test.js test/v3/special-elements.test.js test/v3/links-images.test.js test/v3/limits.test.js test/v3/stream.test.js test/v3/provenance.test.js",
31
32
  "test:core": "pnpm run entities:check && pnpm run typecheck && pnpm run test:unit && pnpm run test:fuzz && pnpm run test:sinks && node test/package-smoke.mjs",
32
33
  "test:fuzz": "pnpm run build && node --test test/v3/fuzz.test.js",
33
34
  "test:sinks": "pnpm run build && node --test test/v3/sinks.test.js",
@@ -66,11 +67,20 @@
66
67
  "backend",
67
68
  "nodejs",
68
69
  "browser",
69
- "edge-runtime"
70
+ "edge-runtime",
71
+ "sanitizer",
72
+ "sanitize",
73
+ "html-sanitizer",
74
+ "xss",
75
+ "cross-site-scripting",
76
+ "xss-prevention",
77
+ "security",
78
+ "strip-tags",
79
+ "escape-html"
70
80
  ],
71
81
  "author": "Purifai Team <it@worksonmy.dev>",
72
82
  "license": "MIT",
73
- "homepage": "https://github.com/moji2002/purifai#readme",
83
+ "homepage": "https://purifai.worksonmy.dev",
74
84
  "repository": {
75
85
  "type": "git",
76
86
  "url": "git+https://github.com/moji2002/purifai.git"