w-dwdata-tweqod 1.0.19 → 1.0.21

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.
@@ -71,7 +71,11 @@ import downloadEqs from './downloadEqs.mjs'
71
71
 
72
72
 
73
73
  /**
74
- * 於OpenData下載台灣氣象署地震資料
74
+ * 基於檔案之下載台灣氣象署OpenData地震數據與任務建構器
75
+ *
76
+ * 執行階段最新hash數據放置於fdDwAttime,前次hash數據放置於fdDwCurrent,於結束前會將fdDwAttime複製蓋過fdDwCurrent
77
+ *
78
+ * 執行階段最新數據放置於fdResult,前次數據會另存備份放置於fdResultTemp,於結束前會將fdResultTemp清空
75
79
  *
76
80
  * @param {String} token 輸入氣象署OpenData之API用token字串
77
81
  * @param {Object} [opt={}] 輸入設定物件,預設{}
@@ -79,8 +83,8 @@ import downloadEqs from './downloadEqs.mjs'
79
83
  * @param {String} [opt.fdDwStorage='./_dwStorage'] 輸入完整下載數據資料夾字串,預設'./_dwStorage'
80
84
  * @param {String} [opt.fdDwAttime='./_dwAttime'] 輸入當前下載供比對hash用之數據資料夾字串,預設'./_dwAttime'
81
85
  * @param {String} [opt.fdDwCurrent='./_dwCurrent'] 輸入已下載供比對hash用之數據資料夾字串,預設'./_dwCurrent'
82
- * @param {String} [opt.fdResultTemp='./_resultTemp'] 輸入若有變更數據時,儲存前次已下載數據所連動生成數據資料夾字串,預設'./_resultTemp'
83
- * @param {String} [opt.fdResult='./_result'] 輸入已下載數據所連動生成數據資料夾字串,預設'./_result'
86
+ * @param {String} [opt.fdResultTemp=`./_resultTemp`] 輸入若有變更數據時,儲存前次已下載數據所連動生成數據資料夾字串,預設`./_resultTemp`
87
+ * @param {String} [opt.fdResult=`./_result`] 輸入已下載數據所連動生成數據資料夾字串,預設`./_result`
84
88
  * @param {String} [opt.fdTaskCpActualSrc='./_taskCpActualSrc'] 輸入任務狀態之來源端完整資料夾字串,預設'./_taskCpActualSrc'
85
89
  * @param {String} [opt.fdTaskCpSrc='./_taskCpSrc'] 輸入任務狀態之來源端資料夾字串,預設'./_taskCpSrc'
86
90
  * @param {String} [opt.fdLog='./_logs'] 輸入儲存log資料夾字串,預設'./_logs'
@@ -116,11 +120,11 @@ import downloadEqs from './downloadEqs.mjs'
116
120
  * w.fsCleanFolder(fdDwCurrent)
117
121
  *
118
122
  * //fdResultTemp
119
- * let fdResultTemp = './_resultTemp'
123
+ * let fdResultTemp = `./_resultTemp`
120
124
  * w.fsCleanFolder(fdResultTemp)
121
125
  *
122
126
  * //fdResult
123
- * let fdResult = './_result'
127
+ * let fdResult = `./_result`
124
128
  * w.fsCleanFolder(fdResult)
125
129
  *
126
130
  * let opt = {
@@ -198,7 +202,7 @@ let WDwdataTweqod = async(token, opt = {}) => {
198
202
  //fdResultTemp
199
203
  let fdResultTemp = get(opt, 'fdResultTemp')
200
204
  if (!isestr(fdResultTemp)) {
201
- fdResultTemp = './_resultTemp'
205
+ fdResultTemp = `./_resultTemp`
202
206
  }
203
207
  if (!fsIsFolder(fdResultTemp)) {
204
208
  fsCreateFolder(fdResultTemp)
@@ -207,7 +211,7 @@ let WDwdataTweqod = async(token, opt = {}) => {
207
211
  //fdResult
208
212
  let fdResult = get(opt, 'fdResult')
209
213
  if (!isestr(fdResult)) {
210
- fdResult = './_result'
214
+ fdResult = `./_result`
211
215
  }
212
216
  if (!fsIsFolder(fdResult)) {
213
217
  fsCreateFolder(fdResult)
@@ -471,7 +475,6 @@ let WDwdataTweqod = async(token, opt = {}) => {
471
475
 
472
476
  }
473
477
 
474
- //WDwdataBuilder
475
478
  let optBdr = {
476
479
  fdDwAttime,
477
480
  fdDwCurrent,
@@ -508,7 +511,7 @@ export default WDwdataTweqod
508
511
  <br class="clear">
509
512
 
510
513
  <footer>
511
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.4</a> on Thu Sep 11 2025 22:12:23 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
514
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.4</a> on Fri Sep 12 2025 11:38:33 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
512
515
  </footer>
513
516
 
514
517
  <script>prettyPrint();</script>
package/docs/global.html CHANGED
@@ -140,13 +140,15 @@
140
140
  <dl class="details">
141
141
 
142
142
  <dt class="tag-description">Description:</dt>
143
- <dd class="tag-description"><ul class="dummy"><li><p>於OpenData下載台灣氣象署地震資料</p></li></ul></dd>
143
+ <dd class="tag-description"><ul class="dummy"><li><p>基於檔案之下載台灣氣象署OpenData地震數據與任務建構器</p>
144
+ <p>執行階段最新hash數據放置於fdDwAttime,前次hash數據放置於fdDwCurrent,於結束前會將fdDwAttime複製蓋過fdDwCurrent</p>
145
+ <p>執行階段最新數據放置於fdResult,前次數據會另存備份放置於fdResultTemp,於結束前會將fdResultTemp清空</p></li></ul></dd>
144
146
 
145
147
 
146
148
 
147
149
  <dt class="tag-source">Source:</dt>
148
150
  <dd class="tag-source"><ul class="dummy"><li>
149
- <a href="WDwdataTweqod.mjs.html">WDwdataTweqod.mjs</a>, <a href="WDwdataTweqod.mjs.html#line116">line 116</a>
151
+ <a href="WDwdataTweqod.mjs.html">WDwdataTweqod.mjs</a>, <a href="WDwdataTweqod.mjs.html#line120">line 120</a>
150
152
  </li></ul></dd>
151
153
 
152
154
 
@@ -193,7 +195,7 @@
193
195
 
194
196
  <h5 class="h5-examples">Example</h5>
195
197
 
196
- <pre class="prettyprint"><code>import fs from 'fs'
197
198
  keepAllData: false,
198
199
  fdDwStorage,
199
200
  fdDwAttime,
200
201
  fdDwCurrent,
201
202
  fdResultTemp,
202
203
  fdResult,
203
204
  // funDownload,
204
205
  // funGetCurrent,
205
206
  // funRemove,
206
207
  // funAdd,
207
208
  // funModify,
208
209
  .catch((err) => {
209
210
  console.log(err)
210
211
  })
211
212
  delete msg.type
212
213
  console.log('change', msg)
214
+ <pre class="prettyprint"><code>import fs from 'fs'
213
215
  keepAllData: false,
214
216
  fdDwStorage,
215
217
  fdDwAttime,
216
218
  fdDwCurrent,
217
219
  fdResultTemp,
218
220
  fdResult,
219
221
  // funDownload,
220
222
  // funGetCurrent,
221
223
  // funRemove,
222
224
  // funAdd,
223
225
  // funModify,
224
226
  .catch((err) => {
225
227
  console.log(err)
226
228
  })
227
229
  delete msg.type
228
230
  console.log('change', msg)
229
231
 
230
232
 
231
233
 
@@ -514,12 +516,12 @@
514
516
 
515
517
  <td class="default">
516
518
 
517
- <code>'./_resultTemp'</code>
519
+ <code>`./_resultTemp`</code>
518
520
 
519
521
  </td>
520
522
 
521
523
 
522
- <td class="description last"><p>輸入若有變更數據時,儲存前次已下載數據所連動生成數據資料夾字串,預設'./_resultTemp'</p></td>
524
+ <td class="description last"><p>輸入若有變更數據時,儲存前次已下載數據所連動生成數據資料夾字串,預設<code>./_resultTemp</code></p></td>
523
525
  </tr>
524
526
 
525
527
 
@@ -554,12 +556,12 @@
554
556
 
555
557
  <td class="default">
556
558
 
557
- <code>'./_result'</code>
559
+ <code>`./_result`</code>
558
560
 
559
561
  </td>
560
562
 
561
563
 
562
- <td class="description last"><p>輸入已下載數據所連動生成數據資料夾字串,預設'./_result'</p></td>
564
+ <td class="description last"><p>輸入已下載數據所連動生成數據資料夾字串,預設<code>./_result</code></p></td>
563
565
  </tr>
564
566
 
565
567
 
@@ -1034,7 +1036,7 @@
1034
1036
  <br class="clear">
1035
1037
 
1036
1038
  <footer>
1037
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.4</a> on Thu Sep 11 2025 22:12:23 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1039
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.4</a> on Fri Sep 12 2025 11:38:33 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1038
1040
  </footer>
1039
1041
 
1040
1042
  <script>prettyPrint();</script>
package/docs/index.html CHANGED
@@ -71,7 +71,7 @@
71
71
  <br class="clear">
72
72
 
73
73
  <footer>
74
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.4</a> on Thu Sep 11 2025 22:12:23 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
74
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.4</a> on Fri Sep 12 2025 11:38:33 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
75
75
  </footer>
76
76
 
77
77
  <script>prettyPrint();</script>
@@ -105,19 +105,19 @@ let fdDwCurrent = `./_dwCurrent`
105
105
  w.fsCleanFolder(fdDwCurrent)
106
106
 
107
107
  //fdResultTemp
108
- let fdResultTemp = './_resultTemp'
108
+ let fdResultTemp = `./_resultTemp`
109
109
  w.fsCleanFolder(fdResultTemp)
110
110
 
111
111
  //fdResult
112
- let fdResult = './_result'
112
+ let fdResult = `./_result`
113
113
  w.fsCleanFolder(fdResult)
114
114
 
115
115
  let i = 0
116
116
  let run = async() => {
117
- let pm = w.genPm()
118
-
119
117
  i++
120
118
 
119
+ let pm = w.genPm()
120
+
121
121
  let j = fs.readFileSync('../_data/settings.json', 'utf8')
122
122
  let st = JSON.parse(j)
123
123
  let token = _.get(st, 'token')
@@ -161,7 +161,7 @@ let run = async() => {
161
161
  }
162
162
  console.log('change', msg)
163
163
  })
164
- ev.on('end', (msg) => {
164
+ ev.on('end', () => {
165
165
  pm.resolve()
166
166
  })
167
167
 
package/g.mjs CHANGED
@@ -22,11 +22,11 @@ let fdDwCurrent = `./_dwCurrent`
22
22
  w.fsCleanFolder(fdDwCurrent)
23
23
 
24
24
  //fdResultTemp
25
- let fdResultTemp = './_resultTemp'
25
+ let fdResultTemp = `./_resultTemp`
26
26
  w.fsCleanFolder(fdResultTemp)
27
27
 
28
28
  //fdResult
29
- let fdResult = './_result'
29
+ let fdResult = `./_result`
30
30
  w.fsCleanFolder(fdResult)
31
31
 
32
32
  let opt = {
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "w-dwdata-tweqod",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "main": "dist/w-dwdata-tweqod.umd.js",
5
5
  "dependencies": {
6
- "axios": "^1.11.0",
6
+ "axios": "^1.12.0",
7
7
  "lodash-es": "^4.17.21",
8
- "w-dwdata-builder": "^1.0.21",
8
+ "w-dwdata-builder": "^1.0.23",
9
9
  "wsemi": "^1.8.20"
10
10
  },
11
11
  "devDependencies": {
@@ -24,7 +24,11 @@ import downloadEqs from './downloadEqs.mjs'
24
24
 
25
25
 
26
26
  /**
27
- * 於OpenData下載台灣氣象署地震資料
27
+ * 基於檔案之下載台灣氣象署OpenData地震數據與任務建構器
28
+ *
29
+ * 執行階段最新hash數據放置於fdDwAttime,前次hash數據放置於fdDwCurrent,於結束前會將fdDwAttime複製蓋過fdDwCurrent
30
+ *
31
+ * 執行階段最新數據放置於fdResult,前次數據會另存備份放置於fdResultTemp,於結束前會將fdResultTemp清空
28
32
  *
29
33
  * @param {String} token 輸入氣象署OpenData之API用token字串
30
34
  * @param {Object} [opt={}] 輸入設定物件,預設{}
@@ -32,8 +36,8 @@ import downloadEqs from './downloadEqs.mjs'
32
36
  * @param {String} [opt.fdDwStorage='./_dwStorage'] 輸入完整下載數據資料夾字串,預設'./_dwStorage'
33
37
  * @param {String} [opt.fdDwAttime='./_dwAttime'] 輸入當前下載供比對hash用之數據資料夾字串,預設'./_dwAttime'
34
38
  * @param {String} [opt.fdDwCurrent='./_dwCurrent'] 輸入已下載供比對hash用之數據資料夾字串,預設'./_dwCurrent'
35
- * @param {String} [opt.fdResultTemp='./_resultTemp'] 輸入若有變更數據時,儲存前次已下載數據所連動生成數據資料夾字串,預設'./_resultTemp'
36
- * @param {String} [opt.fdResult='./_result'] 輸入已下載數據所連動生成數據資料夾字串,預設'./_result'
39
+ * @param {String} [opt.fdResultTemp=`./_resultTemp`] 輸入若有變更數據時,儲存前次已下載數據所連動生成數據資料夾字串,預設`./_resultTemp`
40
+ * @param {String} [opt.fdResult=`./_result`] 輸入已下載數據所連動生成數據資料夾字串,預設`./_result`
37
41
  * @param {String} [opt.fdTaskCpActualSrc='./_taskCpActualSrc'] 輸入任務狀態之來源端完整資料夾字串,預設'./_taskCpActualSrc'
38
42
  * @param {String} [opt.fdTaskCpSrc='./_taskCpSrc'] 輸入任務狀態之來源端資料夾字串,預設'./_taskCpSrc'
39
43
  * @param {String} [opt.fdLog='./_logs'] 輸入儲存log資料夾字串,預設'./_logs'
@@ -69,11 +73,11 @@ import downloadEqs from './downloadEqs.mjs'
69
73
  * w.fsCleanFolder(fdDwCurrent)
70
74
  *
71
75
  * //fdResultTemp
72
- * let fdResultTemp = './_resultTemp'
76
+ * let fdResultTemp = `./_resultTemp`
73
77
  * w.fsCleanFolder(fdResultTemp)
74
78
  *
75
79
  * //fdResult
76
- * let fdResult = './_result'
80
+ * let fdResult = `./_result`
77
81
  * w.fsCleanFolder(fdResult)
78
82
  *
79
83
  * let opt = {
@@ -151,7 +155,7 @@ let WDwdataTweqod = async(token, opt = {}) => {
151
155
  //fdResultTemp
152
156
  let fdResultTemp = get(opt, 'fdResultTemp')
153
157
  if (!isestr(fdResultTemp)) {
154
- fdResultTemp = './_resultTemp'
158
+ fdResultTemp = `./_resultTemp`
155
159
  }
156
160
  if (!fsIsFolder(fdResultTemp)) {
157
161
  fsCreateFolder(fdResultTemp)
@@ -160,7 +164,7 @@ let WDwdataTweqod = async(token, opt = {}) => {
160
164
  //fdResult
161
165
  let fdResult = get(opt, 'fdResult')
162
166
  if (!isestr(fdResult)) {
163
- fdResult = './_result'
167
+ fdResult = `./_result`
164
168
  }
165
169
  if (!fsIsFolder(fdResult)) {
166
170
  fsCreateFolder(fdResult)
@@ -424,7 +428,6 @@ let WDwdataTweqod = async(token, opt = {}) => {
424
428
 
425
429
  }
426
430
 
427
- //WDwdataBuilder
428
431
  let optBdr = {
429
432
  fdDwAttime,
430
433
  fdDwCurrent,
@@ -110,19 +110,19 @@ describe('multi', function() {
110
110
  w.fsCleanFolder(fdDwCurrent)
111
111
 
112
112
  //fdResultTemp
113
- let fdResultTemp = './_multi_resultTemp'
113
+ let fdResultTemp = `./_multi_resultTemp`
114
114
  w.fsCleanFolder(fdResultTemp)
115
115
 
116
116
  //fdResult
117
- let fdResult = './_multi_result'
117
+ let fdResult = `./_multi_result`
118
118
  w.fsCleanFolder(fdResult)
119
119
 
120
120
  let i = 0
121
121
  let run = async() => {
122
- let pm = w.genPm()
123
-
124
122
  i++
125
123
 
124
+ let pm = w.genPm()
125
+
126
126
  let j = fs.readFileSync('../_data/settings.json', 'utf8')
127
127
  let st = JSON.parse(j)
128
128
  let token = _.get(st, 'token')
@@ -30,11 +30,11 @@ describe('once', function() {
30
30
  w.fsCleanFolder(fdDwCurrent)
31
31
 
32
32
  //fdResultTemp
33
- let fdResultTemp = './_once_resultTemp'
33
+ let fdResultTemp = `./_once_resultTemp`
34
34
  w.fsCleanFolder(fdResultTemp)
35
35
 
36
36
  //fdResult
37
- let fdResult = './_once_result'
37
+ let fdResult = `./_once_result`
38
38
  w.fsCleanFolder(fdResult)
39
39
 
40
40
  //funDownloadEqs
@@ -1 +0,0 @@
1
- {"114106":"eyJpZCI6IjExNDEwNiIsImhhc2giOiI1MzcwMzYyNDI0NTQwY2QwIn0=","114107":"eyJpZCI6IjExNDEwNyIsImhhc2giOiI1MGQ4ZmFlNzRhMzc1MTRlIn0=","114108":"eyJpZCI6IjExNDEwOCIsImhhc2giOiIxMDY0OWMzYTg4OGE5Y2QzIn0=","114109":"eyJpZCI6IjExNDEwOSIsImhhc2giOiJhZWJhN2E0MWI4YTc3MDg4In0=","114110":"eyJpZCI6IjExNDExMCIsImhhc2giOiI3ZWMxNDVlZGYxZGFhY2IzIn0=","114111":"eyJpZCI6IjExNDExMSIsImhhc2giOiIwOTU2YjNjZmE3ZmNmOTVkIn0=","114112":"eyJpZCI6IjExNDExMiIsImhhc2giOiI2ODU1YmVhMDZlNDUwYTExIn0=","114113":"eyJpZCI6IjExNDExMyIsImhhc2giOiI2Njk5OGFmZDhlMGRmMjZhIn0=","114114":"eyJpZCI6IjExNDExNCIsImhhc2giOiJlZTYyYzBlNDk4YzRjZTFiIn0=","114115":"eyJpZCI6IjExNDExNSIsImhhc2giOiIxNjQzNWU1OGVmZjVlZTFjIn0=","114116":"eyJpZCI6IjExNDExNiIsImhhc2giOiI0Mjk0YWIxMjg0ODBkMGE4In0=","114117":"eyJpZCI6IjExNDExNyIsImhhc2giOiIxZGMxNDg1MDFkZGI4NzkzIn0=","114118":"eyJpZCI6IjExNDExOCIsImhhc2giOiI2OTdhNGVmNjUzNTUxNjQ0In0=","114119":"eyJpZCI6IjExNDExOSIsImhhc2giOiI2MzU5N2Y0MGIxZDE4ZDZhIn0=","114120":"eyJpZCI6IjExNDEyMCIsImhhc2giOiJlZmY1OWJiYmM0MmQ0YTY1In0=","114121":"eyJpZCI6IjExNDEyMSIsImhhc2giOiIzOGI2ZDI1NTQ3NThlOTJmIn0="}