w-dwdata-tweqod 1.0.0 → 1.0.2

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 CHANGED
@@ -20,5 +20,60 @@ npm i w-dwdata-tweqod
20
20
  #### Example:
21
21
  > **Link:** [[dev source code](https://github.com/yuda-lyu/w-dwdata-tweqod/blob/master/g.mjs)]
22
22
  ```alias
23
- bbb
23
+ import fs from 'fs'
24
+ import _ from 'lodash-es'
25
+ import w from 'wsemi'
26
+ import WDwdataTweqod from './src/WDwdataTweqod.mjs'
27
+
28
+ let j = fs.readFileSync('../_data/settings.json', 'utf8')
29
+ let st = JSON.parse(j)
30
+ let token = _.get(st, 'token')
31
+
32
+ //fdDwStorage
33
+ let fdDwStorage = `./_dwStorage`
34
+ w.fsCleanFolder(fdDwStorage)
35
+
36
+ //fdDwAttime
37
+ let fdDwAttime = `./_dwAttime`
38
+ w.fsCleanFolder(fdDwAttime)
39
+
40
+ //fdDwCurrent
41
+ let fdDwCurrent = `./_dwCurrent`
42
+ w.fsCleanFolder(fdDwCurrent)
43
+
44
+ //fdResult
45
+ let fdResult = './_result'
46
+ w.fsCleanFolder(fdResult)
47
+
48
+ let opt = {
49
+ fdDwStorage,
50
+ fdDwAttime,
51
+ fdDwCurrent,
52
+ fdResult,
53
+ // funDownload,
54
+ // funGetCurrent,
55
+ // funRemove,
56
+ // funAdd,
57
+ // funModify,
58
+ }
59
+ let ev = await WDwdataTweqod(token, opt)
60
+ .catch((err) => {
61
+ console.log(err)
62
+ })
63
+ ev.on('change', (msg) => {
64
+ delete msg.type
65
+ console.log('change', msg)
66
+ })
67
+ // change { event: 'start', msg: 'running...' }
68
+ // change { event: 'proc-callfun-download', msg: 'start...' }
69
+ // change { event: 'proc-callfun-download', msg: 'done' }
70
+ // change { event: 'proc-callfun-getCurrent', msg: 'start...' }
71
+ // change { event: 'proc-callfun-getCurrent', msg: 'done' }
72
+ // change { event: 'compare', msg: 'start...' }
73
+ // change { event: 'compare', msg: 'done' }
74
+ // change { event: 'proc-add-callfun-add', id: '114101', msg: 'start...' }
75
+ // change { event: 'proc-add-callfun-add', id: '114101', msg: 'done' }
76
+ // change { event: 'proc-add-callfun-add', id: '114102', msg: 'start...' }
77
+ // change { event: 'proc-add-callfun-add', id: '114102', msg: 'done' }
78
+ // ...
24
79
  ```