w-dwdata-tweqmp
v1.0.36
Published
A downloader for earthquake PGA data from Taiwan CWA.
Maintainers
Readme
w-dwdata-tweqmp
A downloader for earthquake PGA data from Taiwan CWA.
Documentation
To view documentation or get support, visit docs.
Installation
Using npm(ES6 module):
npm i w-dwdata-tweqmpExample:
Link: [dev source code]
import w from 'wsemi'
import WDwdataTweqmp from './src/WDwdataTweqmp.mjs'
let st = {
'transportation': 'FTP',
'hostname': '{hostname}',
'port': 21,
'username': '{username}',
'password': '{password}',
'fdIni': './'
}
//fdTagRemove
let fdTagRemove = `./_tagRemove`
w.fsCleanFolder(fdTagRemove)
//fdDwStorageTemp
let fdDwStorageTemp = `./_dwStorageTemp`
w.fsCleanFolder(fdDwStorageTemp)
//fdDwStorage
let fdDwStorage = `./_dwStorage`
w.fsCleanFolder(fdDwStorage)
//fdDwAttime
let fdDwAttime = `./_dwAttime`
w.fsCleanFolder(fdDwAttime)
//fdDwCurrent
let fdDwCurrent = `./_dwCurrent`
w.fsCleanFolder(fdDwCurrent)
//fdResultTemp
let fdResultTemp = './_resultTemp'
w.fsCleanFolder(fdResultTemp)
//fdResult
let fdResult = './_result'
w.fsCleanFolder(fdResult)
//fdTaskCpActualSrc
let fdTaskCpActualSrc = `./_taskCpActualSrc`
w.fsCleanFolder(fdTaskCpActualSrc)
//fdTaskCpSrc
let fdTaskCpSrc = `./_taskCpSrc`
w.fsCleanFolder(fdTaskCpSrc)
let opt = {
fdTagRemove,
fdDwStorageTemp,
fdDwStorage,
fdDwAttime,
fdDwCurrent,
fdResultTemp,
fdResult,
fdTaskCpActualSrc,
fdTaskCpSrc,
// fdLog,
// funDownload,
// funGetCurrent,
// funRemove,
// funAdd,
// funModify,
}
let ev = await WDwdataTweqmp(st, opt)
.catch((err) => {
console.log(err)
})
ev.on('change', (msg) => {
delete msg.type
console.log('change', msg)
})
// change { event: 'start', msg: 'running...' }
// change { event: 'proc-callfun-download', msg: 'start...' }
// change { event: 'proc-callfun-download', num: 2, msg: 'done' }
// change { event: 'proc-callfun-getCurrent', msg: 'start...' }
// change { event: 'proc-callfun-getCurrent', num: 0, msg: 'done' }
// change { event: 'proc-compare', msg: 'start...' }
// change { event: 'proc-compare', numRemove: 0, numAdd: 2, numModify: 0, numSame: 0, msg: 'done' }
// change { event: 'proc-add-callfun-add', id: '100000-townshipInt-All.txt', msg: 'start...' }
// change { event: 'proc-add-callfun-add', id: '100000-townshipInt-All.txt', msg: 'done' }
// change { event: 'proc-add-callfun-add', id: '100001-townshipInt-All.txt', msg: 'start...' }
// change { event: 'proc-add-callfun-add', id: '100001-townshipInt-All.txt', msg: 'done' }
// ...