@zhaoshijun/compress 1.4.2 → 1.4.3
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/bin/compress.js +5 -3
- package/package.json +1 -1
package/bin/compress.js
CHANGED
|
@@ -16,6 +16,8 @@ import { createRequire } from 'module';
|
|
|
16
16
|
const require = createRequire(import.meta.url);
|
|
17
17
|
const packageJson = require('../package.json');
|
|
18
18
|
|
|
19
|
+
const currentYear = new Date().getFullYear();
|
|
20
|
+
|
|
19
21
|
const program = new Command();
|
|
20
22
|
|
|
21
23
|
program
|
|
@@ -31,7 +33,7 @@ ${chalk.bold('📦 使用示例:')}
|
|
|
31
33
|
${chalk.green('compress')}
|
|
32
34
|
|
|
33
35
|
${chalk.gray('# 压缩并添加文本水印')}
|
|
34
|
-
${chalk.green(
|
|
36
|
+
${chalk.green(`compress -w --watermark-text "Copyright ${currentYear}"`)}
|
|
35
37
|
|
|
36
38
|
${chalk.gray('# 压缩并添加图片水印')}
|
|
37
39
|
${chalk.green('compress -w --watermark-mode image --watermark-image "./logo.png"')}
|
|
@@ -93,7 +95,7 @@ ${chalk.bold('📋 水印位置:')}
|
|
|
93
95
|
|
|
94
96
|
${chalk.bold('📖 更多信息:')}
|
|
95
97
|
|
|
96
|
-
完整文档: https://
|
|
98
|
+
完整文档: https://www.npmjs.com/package/@zhaoshijun/compress
|
|
97
99
|
`)
|
|
98
100
|
.action(async (options) => {
|
|
99
101
|
try {
|
|
@@ -342,7 +344,7 @@ ${chalk.yellow('【通用选项】')}
|
|
|
342
344
|
${chalk.bold('💧 使用示例:')}
|
|
343
345
|
|
|
344
346
|
# 文本水印
|
|
345
|
-
compress watermark --watermark-text "Copyright
|
|
347
|
+
compress watermark --watermark-text "Copyright ${currentYear}"
|
|
346
348
|
|
|
347
349
|
# 图片水印(右下角)
|
|
348
350
|
compress watermark --watermark-mode image --watermark-image "./logo.png" --watermark-position bottom-right
|