@d-zero/print 2.4.7 → 2.5.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 +1 -0
- package/dist/cli.js +5 -0
- package/dist/modules/print-pdf-with-note.js +3 -3
- package/package.json +9 -9
package/README.md
CHANGED
package/dist/cli.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
2
3
|
import { createCLI, parseCommonOptions, parseList } from '@d-zero/cli-core';
|
|
3
4
|
import { parseDevicesOption } from '@d-zero/puppeteer-page-scan';
|
|
4
5
|
import { print } from './print-main-process.js';
|
|
5
6
|
import { readConfig } from './read-config.js';
|
|
7
|
+
const require = createRequire(import.meta.url);
|
|
8
|
+
const pkg = require('../package.json');
|
|
6
9
|
const { options, args, hasConfigFile } = createCLI({
|
|
10
|
+
name: pkg.name,
|
|
11
|
+
version: pkg.version,
|
|
7
12
|
aliases: {
|
|
8
13
|
f: 'listfile',
|
|
9
14
|
t: 'type',
|
|
@@ -10,7 +10,7 @@ import dayjs from 'dayjs';
|
|
|
10
10
|
*/
|
|
11
11
|
export async function printPdfWithNote(page, { id, filePath, url, title }) {
|
|
12
12
|
if (!filePath) {
|
|
13
|
-
throw new Error(`No file path (ID: ${id}): ${url}`);
|
|
13
|
+
throw new Error(`No file path (ID: "${id}"): ${url}`);
|
|
14
14
|
}
|
|
15
15
|
const datetime = dayjs().format('YYYY-MM-DD HH:mm');
|
|
16
16
|
await page.evaluate(() => {
|
|
@@ -37,7 +37,7 @@ export async function printPdfWithNote(page, { id, filePath, url, title }) {
|
|
|
37
37
|
<div style="font-size: 0.6em">Printed: ${datetime}</div>
|
|
38
38
|
</div>
|
|
39
39
|
<div>
|
|
40
|
-
<div style="font-size: 3mm; margin-bottom: 1mm; text-align: right;">[
|
|
40
|
+
<div style="font-size: 3mm; margin-bottom: 1mm; text-align: right;">[${id}]</div>
|
|
41
41
|
<div style="text-align: right; background-color: #000; color: #fff;">Note:</div>
|
|
42
42
|
</div>
|
|
43
43
|
</div>
|
|
@@ -45,7 +45,7 @@ export async function printPdfWithNote(page, { id, filePath, url, title }) {
|
|
|
45
45
|
footerTemplate: `
|
|
46
46
|
<div style="font-size: 2mm; width: 100%; display: flex; justify-content: space-between; margin: 0 1cm; font-family: monospace;">
|
|
47
47
|
<div>
|
|
48
|
-
<span>[
|
|
48
|
+
<span>[${id}] ${url}</span>
|
|
49
49
|
</div>
|
|
50
50
|
<div>
|
|
51
51
|
<span class="pageNumber"></span>/<span class="totalPages"></span>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d-zero/print",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"description": "Print web pages to PDF or image files.",
|
|
5
5
|
"author": "D-ZERO",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,18 +24,18 @@
|
|
|
24
24
|
"clean": "tsc --build --clean"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@d-zero/cli-core": "1.
|
|
27
|
+
"@d-zero/cli-core": "1.3.0",
|
|
28
28
|
"@d-zero/html-distiller": "2.0.3",
|
|
29
|
-
"@d-zero/puppeteer-dealer": "0.6.
|
|
30
|
-
"@d-zero/puppeteer-page-scan": "4.3.
|
|
31
|
-
"@d-zero/puppeteer-screenshot": "3.2.
|
|
32
|
-
"@d-zero/readtext": "1.1.
|
|
33
|
-
"@d-zero/shared": "0.17.
|
|
29
|
+
"@d-zero/puppeteer-dealer": "0.6.4",
|
|
30
|
+
"@d-zero/puppeteer-page-scan": "4.3.5",
|
|
31
|
+
"@d-zero/puppeteer-screenshot": "3.2.14",
|
|
32
|
+
"@d-zero/readtext": "1.1.15",
|
|
33
|
+
"@d-zero/shared": "0.17.1",
|
|
34
34
|
"ansi-colors": "4.1.3",
|
|
35
35
|
"dayjs": "1.11.19",
|
|
36
36
|
"front-matter": "4.0.2",
|
|
37
37
|
"minimist": "1.2.8",
|
|
38
|
-
"puppeteer": "24.
|
|
38
|
+
"puppeteer": "24.34.0"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "9aa03b3928e271d45865c6e2eff4c89041fe20a2"
|
|
41
41
|
}
|