@holmdigital/engine 1.4.11 → 2.0.0
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.
- package/LICENSE +59 -59
- package/README.md +198 -158
- package/dist/{chunk-BKI2FFUX.mjs → chunk-32WU5BD6.mjs} +151 -15
- package/dist/{chunk-WZSPSYDS.mjs → chunk-ZO2XNHHT.mjs} +179 -10
- package/dist/cli/index.js +594 -48
- package/dist/cli/index.mjs +194 -56
- package/dist/github-actions-CGWJSLMB.mjs +24 -0
- package/dist/{i18n-M6ATDHUS.mjs → i18n-VBP5BVTT.mjs} +1 -1
- package/dist/index.d.mts +21 -2
- package/dist/index.d.ts +21 -2
- package/dist/index.js +342 -12
- package/dist/index.mjs +7 -3
- package/dist/junit-generator-FK3GE5E4.mjs +43 -0
- package/package.json +84 -79
package/LICENSE
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Holm Digital AB
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
22
|
-
|
|
23
|
-
================================================================================
|
|
24
|
-
|
|
25
|
-
THIRD PARTY NOTICES
|
|
26
|
-
|
|
27
|
-
This project includes code or libraries from third parties.
|
|
28
|
-
|
|
29
|
-
1. axe-core
|
|
30
|
-
License: Mozilla Public License 2.0 (MPL-2.0)
|
|
31
|
-
Source: https://github.com/dequelabs/axe-core
|
|
32
|
-
|
|
33
|
-
This software is used unmodified as a dependency.
|
|
34
|
-
The Source Code Form of axe-core is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
35
|
-
If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
36
|
-
|
|
37
|
-
2. puppeteer
|
|
38
|
-
License: Apache License 2.0
|
|
39
|
-
Source: https://github.com/puppeteer/puppeteer
|
|
40
|
-
|
|
41
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
42
|
-
you may not use this file except in compliance with the License.
|
|
43
|
-
You may obtain a copy of the License at
|
|
44
|
-
|
|
45
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
46
|
-
|
|
47
|
-
Unless required by applicable law or agreed to in writing, software
|
|
48
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
49
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
50
|
-
See the License for the specific language governing permissions and
|
|
51
|
-
limitations under the License.
|
|
52
|
-
|
|
53
|
-
3. React & ReactDOM
|
|
54
|
-
License: MIT
|
|
55
|
-
Source: https://github.com/facebook/react
|
|
56
|
-
|
|
57
|
-
4. Vite
|
|
58
|
-
License: MIT
|
|
59
|
-
Source: https://github.com/vitejs/vite
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Holm Digital AB
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
================================================================================
|
|
24
|
+
|
|
25
|
+
THIRD PARTY NOTICES
|
|
26
|
+
|
|
27
|
+
This project includes code or libraries from third parties.
|
|
28
|
+
|
|
29
|
+
1. axe-core
|
|
30
|
+
License: Mozilla Public License 2.0 (MPL-2.0)
|
|
31
|
+
Source: https://github.com/dequelabs/axe-core
|
|
32
|
+
|
|
33
|
+
This software is used unmodified as a dependency.
|
|
34
|
+
The Source Code Form of axe-core is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
35
|
+
If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
36
|
+
|
|
37
|
+
2. puppeteer
|
|
38
|
+
License: Apache License 2.0
|
|
39
|
+
Source: https://github.com/puppeteer/puppeteer
|
|
40
|
+
|
|
41
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
42
|
+
you may not use this file except in compliance with the License.
|
|
43
|
+
You may obtain a copy of the License at
|
|
44
|
+
|
|
45
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
46
|
+
|
|
47
|
+
Unless required by applicable law or agreed to in writing, software
|
|
48
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
49
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
50
|
+
See the License for the specific language governing permissions and
|
|
51
|
+
limitations under the License.
|
|
52
|
+
|
|
53
|
+
3. React & ReactDOM
|
|
54
|
+
License: MIT
|
|
55
|
+
Source: https://github.com/facebook/react
|
|
56
|
+
|
|
57
|
+
4. Vite
|
|
58
|
+
License: MIT
|
|
59
|
+
Source: https://github.com/vitejs/vite
|
package/README.md
CHANGED
|
@@ -1,158 +1,198 @@
|
|
|
1
|
-
# @holmdigital/engine
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@holmdigital/engine)
|
|
4
|
-
[](https://opensource.org/licenses/MIT)
|
|
5
|
-

|
|
6
|
-
[](https://www.npmjs.com/package/@holmdigital/engine)
|
|
7
|
-
|
|
8
|
-
> Regulatory accessibility test engine with Virtual DOM, Shadow DOM support, and built-in legal compliance reporting.
|
|
9
|
-
|
|
10
|
-
## Why this package?
|
|
11
|
-
|
|
12
|
-
Most accessibility tools give you technical errors (e.g., "Color contrast must be 4.5:1"). This engine bridges the gap between **technical code validation** (using `axe-core`) and **legal compliance** (EN 301 549, Section 508, DOS-lagen).
|
|
13
|
-
|
|
14
|
-
It handles the heavy lifting of:
|
|
15
|
-
1. **Mapping** technical failures to specific legal clauses.
|
|
16
|
-
2. **Validating** HTML structure to ensure test accuracy.
|
|
17
|
-
3. **Reporting** in multiple languages (EN, SV, NL, DE, FR, ES) for non-technical stakeholders.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- **
|
|
25
|
-
- **
|
|
26
|
-
- **
|
|
27
|
-
- **
|
|
28
|
-
- **
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
|
49
|
-
|
|
50
|
-
| `--
|
|
51
|
-
| `--
|
|
52
|
-
| `--
|
|
53
|
-
| `--
|
|
54
|
-
| `--
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
|
129
|
-
|
|
130
|
-
| `
|
|
131
|
-
| `
|
|
132
|
-
| `
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
1
|
+
# @holmdigital/engine
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@holmdigital/engine)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+

|
|
6
|
+
[](https://www.npmjs.com/package/@holmdigital/engine)
|
|
7
|
+
|
|
8
|
+
> Regulatory accessibility test engine with Virtual DOM, Shadow DOM support, and built-in legal compliance reporting.
|
|
9
|
+
|
|
10
|
+
## Why this package?
|
|
11
|
+
|
|
12
|
+
Most accessibility tools give you technical errors (e.g., "Color contrast must be 4.5:1"). This engine bridges the gap between **technical code validation** (using `axe-core`) and **legal compliance** (EN 301 549, Section 508, DOS-lagen).
|
|
13
|
+
|
|
14
|
+
It handles the heavy lifting of:
|
|
15
|
+
1. **Mapping** technical failures to specific legal clauses.
|
|
16
|
+
2. **Validating** HTML structure to ensure test accuracy.
|
|
17
|
+
3. **Reporting** in multiple languages (EN, SV, NL, DE, FR, ES) for non-technical stakeholders.
|
|
18
|
+
4. **CI/CD Pipeline Integration** with automatic enforcement.
|
|
19
|
+
|
|
20
|
+
For a comprehensive guide on CLI flags, CI/CD integration, and configuration files, see the **[Engine Library Catalog](../../docs/reference/engine.md)**.
|
|
21
|
+
|
|
22
|
+
## Features
|
|
23
|
+
|
|
24
|
+
- **Regulatory Mapping**: Maps technical failures to EU laws (EN 301 549, EAA).
|
|
25
|
+
- **HTML Structure Validation**: Built-in `html-validate` checks to prevent false positives/negatives.
|
|
26
|
+
- **Internationalization (i18n)**: Supports English (`en`), Swedish (`sv`), Norwegian (`no`), Finnish (`fi`), Danish (`da`), German (`de`), French (`fr`), Spanish (`es`), and Dutch (`nl`).
|
|
27
|
+
- **Premium V2 Accessibility Statement**: Generates modern, glassmorphism-styled statements compliant with Digg & EU templates.
|
|
28
|
+
- **Multi-Company Metadata**: Easily customize statements via CLI flags or `.a11yrc` for scalable client generation.
|
|
29
|
+
- **Configurable Severity Threshold**: Fail CI only on critical/high issues (configurable).
|
|
30
|
+
- **Rich Metadata**: Includes scan duration, page title, language, and version info.
|
|
31
|
+
- **Pseudo-Automation**: Automatically generates Playwright/Puppeteer test scripts for manual verification steps.
|
|
32
|
+
- **PDF Reporting**: Generates beautiful, compliant PDF reports with severity-sorted violations, HTML error counts, and `@HolmDigital/engine` branding.
|
|
33
|
+
- **TypeScript**: Written in TypeScript with full type definitions included.
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm install @holmdigital/engine
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## CLI Usage
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx hd-a11y-scan <url> [options]
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Options:**
|
|
48
|
+
| Option | Description |
|
|
49
|
+
|--------|-------------|
|
|
50
|
+
| `--lang <code>` | Language code (`en`, `sv`, `de`, `fr`, `es`, `nl`, `no`, `fi`, `da`, `en-gb`, `en-us`, `en-ca`) |
|
|
51
|
+
| `--threshold <level>` | Severity threshold for compliance (`critical`, `high`, `medium`, `low`). Default: `high` |
|
|
52
|
+
| `--ci` | Run in CI mode (exit code 1 on failure) |
|
|
53
|
+
| `--json` | Output results as JSON |
|
|
54
|
+
| `--pdf <path>` | Generate a PDF report |
|
|
55
|
+
| `--statement <path>` | Generate a Premium V2 accessibility statement (HTML) |
|
|
56
|
+
| `--org <name>` | Organization name for the statement metadata |
|
|
57
|
+
| `--email <email>` | Contact email for the statement metadata |
|
|
58
|
+
| `--phone <number>` | Contact phone for the statement metadata |
|
|
59
|
+
| `--response-time <val>` | Response time for the statement metadata |
|
|
60
|
+
| `--publish-date <date>` | Publish date for the website (YYYY-MM-DD) |
|
|
61
|
+
| `--viewport <size>` | Set viewport size (`mobile`, `tablet`, `desktop`, or custom `1024x768`) |
|
|
62
|
+
| `--generate-tests` | Generate Pseudo-Automation tests |
|
|
63
|
+
| `--invalid-https-cert` | Allow scanning sites with invalid/self-signed HTTPS certificates ⚠️ |
|
|
64
|
+
| `--api-key <key>` | API Key for HolmDigital Cloud |
|
|
65
|
+
| `--cloud-url <url>` | Custom Cloud API Endpoint (default: cloud.holmdigital.se) |
|
|
66
|
+
|
|
67
|
+
### 🏆 Accessibility Badge
|
|
68
|
+
If your site achieves a **100% score**, the CLI will generate a [Shields.io](https://shields.io/) badge that you can add to your project's README:
|
|
69
|
+
|
|
70
|
+

|
|
71
|
+
|
|
72
|
+
The badge uses accessible colors (AAA compliant contrast) and is included in both the CLI output and the HTML report.
|
|
73
|
+
|
|
74
|
+
> **⚠️ Security Note:** The `--invalid-https-cert` flag should only be used in trusted environments (local dev, staging). It disables certificate validation and is not recommended for production. *(Contributed by [@FerdiStro](https://github.com/FerdiStro))*
|
|
75
|
+
|
|
76
|
+
**Example:**
|
|
77
|
+
```bash
|
|
78
|
+
# Fail only on critical issues in CI
|
|
79
|
+
npx hd-a11y-scan https://example.com --ci --threshold critical
|
|
80
|
+
|
|
81
|
+
# Full JSON output with metadata
|
|
82
|
+
npx hd-a11y-scan https://example.com --json
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## JSON Output
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"url": "https://example.com",
|
|
90
|
+
"timestamp": "2026-01-13T17:05:11.749Z",
|
|
91
|
+
"metadata": {
|
|
92
|
+
"engineVersion": "1.4.12",
|
|
93
|
+
"axeCoreVersion": "4.10.2",
|
|
94
|
+
"standardsVersion": "1.2.3",
|
|
95
|
+
"scanDuration": 2891,
|
|
96
|
+
"pageTitle": "Example Domain",
|
|
97
|
+
"pageLanguage": "en"
|
|
98
|
+
},
|
|
99
|
+
"stats": {
|
|
100
|
+
"passed": 13,
|
|
101
|
+
"critical": 0,
|
|
102
|
+
"high": 0,
|
|
103
|
+
"medium": 2,
|
|
104
|
+
"low": 0,
|
|
105
|
+
"total": 2
|
|
106
|
+
},
|
|
107
|
+
"legalSummary": {
|
|
108
|
+
"wadApplicable": 2,
|
|
109
|
+
"eaaApplicable": 2,
|
|
110
|
+
"eaaDeadlineViolations": 2
|
|
111
|
+
},
|
|
112
|
+
"score": 90,
|
|
113
|
+
"complianceStatus": "PASS"
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## EU Legal Framework
|
|
118
|
+
|
|
119
|
+
The engine maps violations to EU legal frameworks:
|
|
120
|
+
|
|
121
|
+
| Framework | Description | Deadline |
|
|
122
|
+
|-----------|-------------|----------|
|
|
123
|
+
| **WAD** | Web Accessibility Directive 2016/2102 (Public Sector) | Already in force |
|
|
124
|
+
| **EAA** | European Accessibility Act 2019/882 (Private Sector) | **June 28, 2025** |
|
|
125
|
+
|
|
126
|
+
### legalSummary Fields
|
|
127
|
+
|
|
128
|
+
| Field | Description |
|
|
129
|
+
|-------|-------------|
|
|
130
|
+
| `wadApplicable` | Violations that affect WAD compliance (public sector) |
|
|
131
|
+
| `eaaApplicable` | Violations that affect EAA compliance (private sector) |
|
|
132
|
+
| `eaaDeadlineViolations` | Issues that must be fixed before EAA 2025 deadline |
|
|
133
|
+
|
|
134
|
+
### HTML Report Enhancements
|
|
135
|
+
|
|
136
|
+
The HTML/PDF report now includes:
|
|
137
|
+
- **EU Legal Framework Impact** summary section
|
|
138
|
+
- **WAD/EAA badges** on each violation card
|
|
139
|
+
- **EAA deadline warnings** for issues requiring immediate attention
|
|
140
|
+
|
|
141
|
+
## Severity Threshold
|
|
142
|
+
|
|
143
|
+
The `--threshold` flag controls when `complianceStatus` becomes `FAIL`:
|
|
144
|
+
|
|
145
|
+
| Threshold | Fails on |
|
|
146
|
+
|-----------|----------|
|
|
147
|
+
| `critical` | Only critical violations |
|
|
148
|
+
| `high` (default) | Critical + high violations |
|
|
149
|
+
| `medium` | Critical + high + medium violations |
|
|
150
|
+
| `low` | Any violation |
|
|
151
|
+
|
|
152
|
+
**Why this matters for CI/CD:**
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
# Strict: Block deployment on any serious issue
|
|
156
|
+
npx hd-a11y-scan https://staging.example.com --ci --threshold high
|
|
157
|
+
|
|
158
|
+
# Lenient: Only block on critical issues (like missing alt text)
|
|
159
|
+
npx hd-a11y-scan https://staging.example.com --ci --threshold critical
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Medium violations (like missing `<main>` landmark) won't fail your CI by default, but are still reported for awareness.
|
|
163
|
+
|
|
164
|
+
## Metadata Fields
|
|
165
|
+
|
|
166
|
+
| Field | Description |
|
|
167
|
+
|-------|-------------|
|
|
168
|
+
| `engineVersion` | Version of @holmdigital/engine |
|
|
169
|
+
| `axeCoreVersion` | Version of axe-core used |
|
|
170
|
+
| `standardsVersion` | Version of @holmdigital/standards database |
|
|
171
|
+
| `scanDuration` | Scan time in milliseconds |
|
|
172
|
+
| `pageTitle` | HTML `<title>` of scanned page |
|
|
173
|
+
| `pageLanguage` | `lang` attribute of `<html>` |
|
|
174
|
+
| `stats.passed` | Number of accessibility checks that passed |
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
## Programmatic Usage
|
|
178
|
+
|
|
179
|
+
```typescript
|
|
180
|
+
import { RegulatoryScanner, setLanguage } from '@holmdigital/engine';
|
|
181
|
+
|
|
182
|
+
const scanner = new RegulatoryScanner({
|
|
183
|
+
url: 'https://example.com',
|
|
184
|
+
severityThreshold: 'high' // critical, high, medium, low
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
setLanguage('sv');
|
|
188
|
+
|
|
189
|
+
const result = await scanner.scan();
|
|
190
|
+
|
|
191
|
+
console.log(`Score: ${result.score}`);
|
|
192
|
+
console.log(`Duration: ${result.metadata.scanDuration}ms`);
|
|
193
|
+
console.log(`Passed: ${result.stats.passed}, Failed: ${result.stats.total}`);
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## License
|
|
197
|
+
|
|
198
|
+
MIT © Holm Digital AB
|