pug-site-core 2.0.6 → 2.0.7
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/lib/generate.js +4 -0
- package/package.json +2 -2
package/lib/generate.js
CHANGED
|
@@ -139,6 +139,9 @@ export async function generateGetDataFn() {
|
|
|
139
139
|
*/
|
|
140
140
|
export async function fetchDataToJsonFile(args) {
|
|
141
141
|
try {
|
|
142
|
+
console.log("开始获取数据...");
|
|
143
|
+
let starTime = Date.now();
|
|
144
|
+
|
|
142
145
|
// 解析过滤参数,使用对象解构使代码更清晰
|
|
143
146
|
const { filterFun, filterLang } = args.reduce(
|
|
144
147
|
(acc, item) => {
|
|
@@ -346,6 +349,7 @@ export async function fetchDataToJsonFile(args) {
|
|
|
346
349
|
// 等待所有任务完成
|
|
347
350
|
return new Promise((resolve, reject) => {
|
|
348
351
|
queue.drain(() => {
|
|
352
|
+
console.log("获取数据并写入完成花费:", (Date.now() - starTime) / 1000, "s");
|
|
349
353
|
resolve();
|
|
350
354
|
});
|
|
351
355
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pug-site-core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"axios": "^1.7.7"
|
|
38
38
|
},
|
|
39
39
|
"license": "ISC",
|
|
40
|
-
"description": "
|
|
40
|
+
"description": "增加获取数据的log",
|
|
41
41
|
"files": [
|
|
42
42
|
"lib/",
|
|
43
43
|
"index.js"
|