@vellora/engine-chromium 0.1.0-alpha.4 → 0.1.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/README.md +45 -0
- package/package.json +4 -4
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# @vellora/engine-chromium
|
|
2
|
+
|
|
3
|
+
Optional Chromium-backed renderer for [vellora](https://github.com/diomalta/vellora).
|
|
4
|
+
|
|
5
|
+
Use this package only for templates that need browser print fidelity. The default `vellora` path stays
|
|
6
|
+
native, in-process, and browserless.
|
|
7
|
+
|
|
8
|
+
> **Pre-release (alpha)** — the bridge is implemented and evolving with the fidelity workflow.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install vellora @vellora/engine-chromium
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
This package does **not** install Chromium. It launches a Chromium/Chrome executable supplied by the
|
|
17
|
+
environment.
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { renderPdf } from "vellora";
|
|
23
|
+
|
|
24
|
+
const pdf = await renderPdf(html, data, {
|
|
25
|
+
engine: "chromium",
|
|
26
|
+
chromium: {
|
|
27
|
+
executablePath: process.env.VELLORA_CHROMIUM_EXECUTABLE,
|
|
28
|
+
timeoutMs: 30_000,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
If `chromium.executablePath` is omitted, discovery checks `VELLORA_CHROMIUM_EXECUTABLE`, common local
|
|
34
|
+
Chrome/Chromium paths, and finally a `chromium` command on `PATH`.
|
|
35
|
+
|
|
36
|
+
## When to use it
|
|
37
|
+
|
|
38
|
+
- Use `vellora` alone when your generated document HTML fits the supported subset.
|
|
39
|
+
- Add this package when a specific template must match Chromium/Puppeteer print output.
|
|
40
|
+
- Use `vellora doctor --pixel-diff` to compare a native render against Chromium or a legacy PDF before
|
|
41
|
+
committing a fidelity policy.
|
|
42
|
+
|
|
43
|
+
## License
|
|
44
|
+
|
|
45
|
+
MIT — see [LICENSE](./LICENSE).
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vellora/engine-chromium",
|
|
3
|
-
"version": "0.1.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Optional Chromium-backed browser-fidelity renderer for vellora.",
|
|
5
|
-
"keywords": ["html-to-pdf", "pdf", "chromium", "browser-fidelity"],
|
|
5
|
+
"keywords": ["html-to-pdf", "pdf", "chromium", "browser-fidelity", "puppeteer-alternative"],
|
|
6
6
|
"homepage": "https://github.com/diomalta/vellora#readme",
|
|
7
7
|
"bugs": "https://github.com/diomalta/vellora/issues",
|
|
8
8
|
"repository": {
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"build": "tsc"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"vellora": "0.1.0
|
|
33
|
+
"vellora": "0.1.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@vellora/test-harness": "*",
|
|
37
|
-
"vellora": "0.1.0
|
|
37
|
+
"vellora": "0.1.0"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public",
|