w-ftp 1.0.3 → 1.0.4

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/docs/global.html CHANGED
@@ -27,7 +27,7 @@
27
27
 
28
28
  <nav >
29
29
 
30
- <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#ftpCheckFile">ftpCheckFile</a></li><li><a href="global.html#ftpConn">ftpConn</a></li><li><a href="global.html#ftpDownload">ftpDownload</a></li><li><a href="global.html#ftpLs">ftpLs</a></li><li><a href="global.html#ftpQuit">ftpQuit</a></li><li><a href="global.html#ftpStateFile">ftpStateFile</a></li><li><a href="global.html#ftpSyncToLocal">ftpSyncToLocal</a></li><li><a href="global.html#ftpSyncToRemote">ftpSyncToRemote</a></li><li><a href="global.html#ftpUpload">ftpUpload</a></li><li><a href="global.html#WFtp">WFtp</a></li></ul>
30
+ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#conn">conn</a></li><li><a href="global.html#download">download</a></li><li><a href="global.html#isFile">isFile</a></li><li><a href="global.html#isFolder">isFolder</a></li><li><a href="global.html#ls">ls</a></li><li><a href="global.html#quit">quit</a></li><li><a href="global.html#stateFile">stateFile</a></li><li><a href="global.html#syncToLocal">syncToLocal</a></li><li><a href="global.html#syncToRemote">syncToRemote</a></li><li><a href="global.html#upload">upload</a></li><li><a href="global.html#WFtp">WFtp</a></li></ul>
31
31
  </nav>
32
32
 
33
33
  <div id="main">
@@ -124,7 +124,7 @@
124
124
 
125
125
 
126
126
 
127
- <h4 class="name" id="ftpCheckFile"><span class="type-signature">(async) </span>ftpCheckFile<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
127
+ <h4 class="name" id="conn"><span class="type-signature">(async) </span>conn<span class="signature">(opt<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
128
128
 
129
129
 
130
130
 
@@ -136,7 +136,7 @@
136
136
 
137
137
  <dt class="tag-source">Source:</dt>
138
138
  <dd class="tag-source"><ul class="dummy"><li>
139
- <a href="WFtp.mjs.html">WFtp.mjs</a>, <a href="WFtp.mjs.html#line214">line 214</a>
139
+ <a href="WFtp.mjs.html">WFtp.mjs</a>, <a href="WFtp.mjs.html#line64">line 64</a>
140
140
  </li></ul></dd>
141
141
 
142
142
 
@@ -176,7 +176,7 @@
176
176
 
177
177
 
178
178
  <div class="description usertext">
179
- <p>確認伺服器指定檔案是否存在</p>
179
+ <p>連線至FPT伺服器</p>
180
180
  </div>
181
181
 
182
182
 
@@ -189,7 +189,7 @@
189
189
 
190
190
  <h5>Example</h5>
191
191
 
192
- <pre class="prettyprint"><code>import WFtp from './src/WFtp.mjs'
193
192
  let r
194
193
  let ftp = WFtp()
195
194
  // console.log('ftp', ftp)
196
195
  await ftp.conn({
197
196
  hostname: st.up.hostname,
198
197
  port: st.up.port,
199
198
  username: st.up.username,
200
199
  password: st.up.password,
201
200
  })
202
201
  r = await ftp.checkFile('./_test_upload_client/DECL_20210805055044.csv')
203
202
  console.log('ftp.checkFile', r)
204
203
  r = await ftp.quit()
205
204
  console.log('ftp.quit', r)
206
205
  .catch((err) => {
207
206
  console.log(err)
208
207
  })</code></pre>
208
+ <pre class="prettyprint"><code>import WFtp from './src/WFtp.mjs'
209
209
  let r
210
210
  let ftp = WFtp()
211
211
  // console.log('ftp', ftp)
212
212
  await ftp.conn({
213
213
  hostname: st.up.hostname,
214
214
  port: st.up.port,
215
215
  username: st.up.username,
216
216
  password: st.up.password,
217
217
  })
218
218
  //actions
219
219
  r = await ftp.quit()
220
220
  console.log('ftp.quit', r)
221
221
  .catch((err) => {
222
222
  console.log(err)
223
223
  })</code></pre>
224
224
 
225
225
 
226
226
 
@@ -207,8 +207,12 @@
207
207
  <th>Type</th>
208
208
 
209
209
 
210
+ <th>Attributes</th>
211
+
210
212
 
211
213
 
214
+ <th>Default</th>
215
+
212
216
 
213
217
  <th class="last">Description</th>
214
218
  </tr>
@@ -219,7 +223,67 @@
219
223
 
220
224
  <tr>
221
225
 
222
- <td class="name"><code>opt.fpRemote</code></td>
226
+ <td class="name"><code>opt</code></td>
227
+
228
+
229
+ <td class="type">
230
+
231
+
232
+ <span class="param-type">Object</span>
233
+
234
+
235
+
236
+ </td>
237
+
238
+
239
+ <td class="attributes">
240
+
241
+ &lt;optional><br>
242
+
243
+
244
+
245
+
246
+
247
+ </td>
248
+
249
+
250
+
251
+ <td class="default">
252
+
253
+ <code>{}</code>
254
+
255
+ </td>
256
+
257
+
258
+ <td class="description last"><p>輸入設定物件,預設{}</p>
259
+ <h6>Properties</h6>
260
+
261
+
262
+ <table class="params">
263
+ <thead>
264
+ <tr>
265
+
266
+ <th>Name</th>
267
+
268
+
269
+ <th>Type</th>
270
+
271
+
272
+
273
+
274
+ <th>Default</th>
275
+
276
+
277
+ <th class="last">Description</th>
278
+ </tr>
279
+ </thead>
280
+
281
+ <tbody>
282
+
283
+
284
+ <tr>
285
+
286
+ <td class="name"><code>hostname</code></td>
223
287
 
224
288
 
225
289
  <td class="type">
@@ -234,8 +298,108 @@
234
298
 
235
299
 
236
300
 
301
+ <td class="default">
302
+
303
+ <code>''</code>
304
+
305
+ </td>
306
+
237
307
 
238
- <td class="description last"><p>輸入伺服器上指定檔案字串</p></td>
308
+ <td class="description last"><p>輸入hostname字串</p></td>
309
+ </tr>
310
+
311
+
312
+
313
+ <tr>
314
+
315
+ <td class="name"><code>port</code></td>
316
+
317
+
318
+ <td class="type">
319
+
320
+
321
+ <span class="param-type">Number</span>
322
+
323
+
324
+
325
+ </td>
326
+
327
+
328
+
329
+
330
+ <td class="default">
331
+
332
+ <code>''</code>
333
+
334
+ </td>
335
+
336
+
337
+ <td class="description last"><p>輸入port正整數</p></td>
338
+ </tr>
339
+
340
+
341
+
342
+ <tr>
343
+
344
+ <td class="name"><code>username</code></td>
345
+
346
+
347
+ <td class="type">
348
+
349
+
350
+ <span class="param-type">String</span>
351
+
352
+
353
+
354
+ </td>
355
+
356
+
357
+
358
+
359
+ <td class="default">
360
+
361
+ <code>''</code>
362
+
363
+ </td>
364
+
365
+
366
+ <td class="description last"><p>輸入帳號字串</p></td>
367
+ </tr>
368
+
369
+
370
+
371
+ <tr>
372
+
373
+ <td class="name"><code>password</code></td>
374
+
375
+
376
+ <td class="type">
377
+
378
+
379
+ <span class="param-type">String</span>
380
+
381
+
382
+
383
+ </td>
384
+
385
+
386
+
387
+
388
+ <td class="default">
389
+
390
+ <code>''</code>
391
+
392
+ </td>
393
+
394
+
395
+ <td class="description last"><p>輸入密碼字串</p></td>
396
+ </tr>
397
+
398
+
399
+ </tbody>
400
+ </table>
401
+
402
+ </td>
239
403
  </tr>
240
404
 
241
405
 
@@ -261,7 +425,7 @@
261
425
 
262
426
 
263
427
  <div class="param-desc">
264
- <p>回傳Promise,resolve回傳指定檔案是否存在布林值,reject回傳錯誤訊息</p>
428
+ <p>回傳Promise,resolve回傳成功訊息,reject回傳錯誤訊息</p>
265
429
  </div>
266
430
 
267
431
 
@@ -287,7 +451,7 @@
287
451
 
288
452
 
289
453
 
290
- <h4 class="name" id="ftpConn"><span class="type-signature">(async) </span>ftpConn<span class="signature">(opt<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
454
+ <h4 class="name" id="download"><span class="type-signature">(async) </span>download<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
291
455
 
292
456
 
293
457
 
@@ -299,7 +463,7 @@
299
463
 
300
464
  <dt class="tag-source">Source:</dt>
301
465
  <dd class="tag-source"><ul class="dummy"><li>
302
- <a href="WFtp.mjs.html">WFtp.mjs</a>, <a href="WFtp.mjs.html#line63">line 63</a>
466
+ <a href="WFtp.mjs.html">WFtp.mjs</a>, <a href="WFtp.mjs.html#line295">line 295</a>
303
467
  </li></ul></dd>
304
468
 
305
469
 
@@ -339,7 +503,7 @@
339
503
 
340
504
 
341
505
  <div class="description usertext">
342
- <p>連線至FPT伺服器</p>
506
+ <p>下載伺服器指定檔案至本機</p>
343
507
  </div>
344
508
 
345
509
 
@@ -352,7 +516,7 @@
352
516
 
353
517
  <h5>Example</h5>
354
518
 
355
- <pre class="prettyprint"><code>import WFtp from './src/WFtp.mjs'
356
519
  let r
357
520
  let ftp = WFtp()
358
521
  // console.log('ftp', ftp)
359
522
  await ftp.conn({
360
523
  hostname: st.up.hostname,
361
524
  port: st.up.port,
362
525
  username: st.up.username,
363
526
  password: st.up.password,
364
527
  })
365
528
  //actions
366
529
  r = await ftp.quit()
367
530
  console.log('ftp.quit', r)
368
531
  .catch((err) => {
369
532
  console.log(err)
370
533
  })</code></pre>
534
+ <pre class="prettyprint"><code>import WFtp from './src/WFtp.mjs'
371
535
  let r
372
536
  let ftp = WFtp()
373
537
  // console.log('ftp', ftp)
374
538
  await ftp.conn({
375
539
  hostname: st.up.hostname,
376
540
  port: st.up.port,
377
541
  username: st.up.username,
378
542
  password: st.up.password,
379
543
  })
380
544
  r = await ftp.download('./DECL_20210805055044.csv', './_test_download_client/DECL_20210805055044.csv', (p) => {
381
545
  console.log('ftp.download p', p.name, p.progress)
382
546
  })
383
547
  console.log('ftp.download', r)
384
548
  r = await ftp.quit()
385
549
  console.log('ftp.quit', r)
386
550
  .catch((err) => {
387
551
  console.log(err)
388
552
  })</code></pre>
389
553
 
390
554
 
391
555
 
@@ -386,13 +550,13 @@
386
550
 
387
551
  <tr>
388
552
 
389
- <td class="name"><code>opt</code></td>
553
+ <td class="name"><code>opt.fpRemote</code></td>
390
554
 
391
555
 
392
556
  <td class="type">
393
557
 
394
558
 
395
- <span class="param-type">Object</span>
559
+ <span class="param-type">String</span>
396
560
 
397
561
 
398
562
 
@@ -401,8 +565,6 @@
401
565
 
402
566
  <td class="attributes">
403
567
 
404
- &lt;optional><br>
405
-
406
568
 
407
569
 
408
570
 
@@ -413,40 +575,17 @@
413
575
 
414
576
  <td class="default">
415
577
 
416
- <code>{}</code>
417
-
418
578
  </td>
419
579
 
420
580
 
421
- <td class="description last"><p>輸入設定物件,預設{}</p>
422
- <h6>Properties</h6>
423
-
424
-
425
- <table class="params">
426
- <thead>
427
- <tr>
428
-
429
- <th>Name</th>
430
-
431
-
432
- <th>Type</th>
433
-
434
-
435
-
436
-
437
- <th>Default</th>
438
-
439
-
440
- <th class="last">Description</th>
441
- </tr>
442
- </thead>
581
+ <td class="description last"><p>輸入伺服器上指定檔案字串</p></td>
582
+ </tr>
443
583
 
444
- <tbody>
445
584
 
446
585
 
447
586
  <tr>
448
587
 
449
- <td class="name"><code>hostname</code></td>
588
+ <td class="name"><code>opt.fpLocal</code></td>
450
589
 
451
590
 
452
591
  <td class="type">
@@ -459,110 +598,61 @@
459
598
  </td>
460
599
 
461
600
 
462
-
463
-
464
- <td class="default">
465
-
466
- <code>''</code>
601
+ <td class="attributes">
467
602
 
468
- </td>
469
-
470
-
471
- <td class="description last"><p>輸入hostname字串</p></td>
472
- </tr>
473
603
 
474
-
475
-
476
- <tr>
477
-
478
- <td class="name"><code>port</code></td>
479
-
480
-
481
- <td class="type">
482
-
483
604
 
484
- <span class="param-type">Number</span>
485
-
486
-
487
-
488
- </td>
489
605
 
606
+
607
+ </td>
490
608
 
491
609
 
492
610
 
493
611
  <td class="default">
494
612
 
495
- <code>''</code>
496
-
497
613
  </td>
498
614
 
499
615
 
500
- <td class="description last"><p>輸入port正整數</p></td>
616
+ <td class="description last"><p>輸入本機指定檔案字串</p></td>
501
617
  </tr>
502
618
 
503
619
 
504
620
 
505
621
  <tr>
506
622
 
507
- <td class="name"><code>username</code></td>
623
+ <td class="name"><code>opt.cbProcess</code></td>
508
624
 
509
625
 
510
626
  <td class="type">
511
627
 
512
628
 
513
- <span class="param-type">String</span>
629
+ <span class="param-type">function</span>
514
630
 
515
631
 
516
632
 
517
633
  </td>
518
634
 
519
635
 
520
-
521
-
522
- <td class="default">
636
+ <td class="attributes">
523
637
 
524
- <code>''</code>
638
+ &lt;optional><br>
525
639
 
526
- </td>
527
-
528
-
529
- <td class="description last"><p>輸入帳號字串</p></td>
530
- </tr>
531
-
532
-
533
640
 
534
- <tr>
535
-
536
- <td class="name"><code>password</code></td>
537
-
538
-
539
- <td class="type">
540
-
541
641
 
542
- <span class="param-type">String</span>
543
-
544
-
545
-
546
- </td>
547
642
 
643
+
644
+ </td>
548
645
 
549
646
 
550
647
 
551
648
  <td class="default">
552
649
 
553
- <code>''</code>
650
+ <code>null</code>
554
651
 
555
652
  </td>
556
653
 
557
654
 
558
- <td class="description last"><p>輸入密碼字串</p></td>
559
- </tr>
560
-
561
-
562
- </tbody>
563
- </table>
564
-
565
- </td>
655
+ <td class="description last"><p>輸入回調進度函數</p></td>
566
656
  </tr>
567
657
 
568
658
 
@@ -614,7 +704,7 @@
614
704
 
615
705
 
616
706
 
617
- <h4 class="name" id="ftpDownload"><span class="type-signature">(async) </span>ftpDownload<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
707
+ <h4 class="name" id="isFile"><span class="type-signature">(async) </span>isFile<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
618
708
 
619
709
 
620
710
 
@@ -626,7 +716,7 @@
626
716
 
627
717
  <dt class="tag-source">Source:</dt>
628
718
  <dd class="tag-source"><ul class="dummy"><li>
629
- <a href="WFtp.mjs.html">WFtp.mjs</a>, <a href="WFtp.mjs.html#line256">line 256</a>
719
+ <a href="WFtp.mjs.html">WFtp.mjs</a>, <a href="WFtp.mjs.html#line215">line 215</a>
630
720
  </li></ul></dd>
631
721
 
632
722
 
@@ -666,7 +756,7 @@
666
756
 
667
757
 
668
758
  <div class="description usertext">
669
- <p>下載伺服器指定檔案至本機</p>
759
+ <p>確認伺服器指定檔案是否存在</p>
670
760
  </div>
671
761
 
672
762
 
@@ -679,7 +769,7 @@
679
769
 
680
770
  <h5>Example</h5>
681
771
 
682
- <pre class="prettyprint"><code>import WFtp from './src/WFtp.mjs'
683
772
  let r
684
773
  let ftp = WFtp()
685
774
  // console.log('ftp', ftp)
686
775
  await ftp.conn({
687
776
  hostname: st.up.hostname,
688
777
  port: st.up.port,
689
778
  username: st.up.username,
690
779
  password: st.up.password,
691
780
  })
692
781
  r = await ftp.download('./DECL_20210805055044.csv', './_test_download_client/DECL_20210805055044.csv', (p) => {
693
782
  console.log('ftp.download p', p.name, p.progress)
694
783
  })
695
784
  console.log('ftp.download', r)
696
785
  r = await ftp.quit()
697
786
  console.log('ftp.quit', r)
698
787
  .catch((err) => {
699
788
  console.log(err)
700
789
  })</code></pre>
790
+ <pre class="prettyprint"><code>import WFtp from './src/WFtp.mjs'
701
791
  let r
702
792
  let ftp = WFtp()
703
793
  // console.log('ftp', ftp)
704
794
  await ftp.conn({
705
795
  hostname: st.up.hostname,
706
796
  port: st.up.port,
707
797
  username: st.up.username,
708
798
  password: st.up.password,
709
799
  })
710
800
  r = await ftp.isFile('./_test_upload_client/DECL_20210805055044.csv')
711
801
  console.log('ftp.isFile', r)
712
802
  r = await ftp.quit()
713
803
  console.log('ftp.quit', r)
714
804
  .catch((err) => {
715
805
  console.log(err)
716
806
  })</code></pre>
717
807
 
718
808
 
719
809
 
@@ -697,12 +787,8 @@
697
787
  <th>Type</th>
698
788
 
699
789
 
700
- <th>Attributes</th>
701
-
702
790
 
703
791
 
704
- <th>Default</th>
705
-
706
792
 
707
793
  <th class="last">Description</th>
708
794
  </tr>
@@ -726,96 +812,173 @@
726
812
  </td>
727
813
 
728
814
 
729
- <td class="attributes">
730
-
731
815
 
732
-
733
-
734
-
735
- </td>
736
-
737
-
738
-
739
- <td class="default">
740
-
741
- </td>
742
816
 
743
817
 
744
818
  <td class="description last"><p>輸入伺服器上指定檔案字串</p></td>
745
819
  </tr>
746
820
 
747
821
 
822
+ </tbody>
823
+ </table>
748
824
 
749
- <tr>
750
-
751
- <td class="name"><code>opt.fpLocal</code></td>
752
-
753
825
 
754
- <td class="type">
755
-
756
-
757
- <span class="param-type">String</span>
758
826
 
759
827
 
760
-
761
- </td>
762
828
 
763
-
764
- <td class="attributes">
765
-
766
829
 
767
-
768
830
 
769
-
770
- </td>
771
-
772
831
 
773
-
774
- <td class="default">
775
-
776
- </td>
832
+
833
+
834
+
835
+
836
+
837
+
838
+
839
+
840
+ <h5>Returns:</h5>
841
+
842
+
843
+ <div class="param-desc">
844
+ <p>回傳Promise,resolve回傳指定檔案是否存在布林值,reject回傳錯誤訊息</p>
845
+ </div>
846
+
847
+
848
+
849
+ <dl class="param-type">
850
+ <dt>
851
+ Type
852
+ </dt>
853
+ <dd>
854
+
855
+ <span class="param-type">Promise</span>
856
+
857
+
858
+ </dd>
859
+ </dl>
860
+
861
+
862
+
863
+
864
+
865
+
777
866
 
778
867
 
779
- <td class="description last"><p>輸入本機指定檔案字串</p></td>
780
- </tr>
868
+
869
+
870
+ <h4 class="name" id="isFolder"><span class="type-signature">(async) </span>isFolder<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
871
+
872
+
873
+
874
+
875
+
876
+
877
+ <dl class="details">
878
+
879
+
880
+ <dt class="tag-source">Source:</dt>
881
+ <dd class="tag-source"><ul class="dummy"><li>
882
+ <a href="WFtp.mjs.html">WFtp.mjs</a>, <a href="WFtp.mjs.html#line253">line 253</a>
883
+ </li></ul></dd>
884
+
885
+
886
+
887
+
888
+
889
+
890
+
891
+
892
+
893
+
894
+
895
+
896
+
897
+
898
+
899
+
900
+
901
+
902
+
903
+
904
+
905
+
906
+
907
+
908
+
909
+
910
+
911
+
912
+
913
+
914
+
915
+ </dl>
916
+
917
+
918
+
919
+
920
+
921
+ <div class="description usertext">
922
+ <p>確認伺服器指定資料夾是否存在</p>
923
+ </div>
924
+
925
+
926
+
927
+
928
+
929
+
930
+
931
+
932
+
933
+ <h5>Example</h5>
934
+
935
+ <pre class="prettyprint"><code>import WFtp from './src/WFtp.mjs'
781
936
  let r
782
937
  let ftp = WFtp()
783
938
  // console.log('ftp', ftp)
784
939
  await ftp.conn({
785
940
  hostname: st.up.hostname,
786
941
  port: st.up.port,
787
942
  username: st.up.username,
788
943
  password: st.up.password,
789
944
  })
790
945
  r = await ftp.isFolder('./_test_upload_client')
791
946
  console.log('ftp.isFolder', r)
792
947
  r = await ftp.quit()
793
948
  console.log('ftp.quit', r)
794
949
  .catch((err) => {
795
950
  console.log(err)
796
951
  })</code></pre>
952
+
953
+
954
+
797
955
 
956
+ <h5>Parameters:</h5>
957
+
958
+
959
+ <table class="params">
960
+ <thead>
961
+ <tr>
962
+
963
+ <th>Name</th>
964
+
965
+
966
+ <th>Type</th>
967
+
968
+
969
+
970
+
971
+
972
+ <th class="last">Description</th>
973
+ </tr>
974
+ </thead>
975
+
976
+ <tbody>
798
977
 
799
978
 
800
979
  <tr>
801
980
 
802
- <td class="name"><code>opt.cbProcess</code></td>
981
+ <td class="name"><code>opt.fpRemote</code></td>
803
982
 
804
983
 
805
984
  <td class="type">
806
985
 
807
986
 
808
- <span class="param-type">function</span>
987
+ <span class="param-type">String</span>
809
988
 
810
989
 
811
990
 
812
991
  </td>
813
992
 
814
993
 
815
- <td class="attributes">
816
-
817
- &lt;optional><br>
818
-
819
994
 
820
-
821
-
822
-
823
- </td>
824
-
825
-
826
-
827
- <td class="default">
828
-
829
- <code>null</code>
830
-
831
- </td>
832
995
 
833
996
 
834
- <td class="description last"><p>輸入回調進度函數</p></td>
997
+ <td class="description last"><p>輸入伺服器上指定資料夾字串</p></td>
835
998
  </tr>
836
999
 
837
1000
 
@@ -841,7 +1004,7 @@
841
1004
 
842
1005
 
843
1006
  <div class="param-desc">
844
- <p>回傳Promise,resolve回傳成功訊息,reject回傳錯誤訊息</p>
1007
+ <p>回傳Promise,resolve回傳指定資料夾是否存在布林值,reject回傳錯誤訊息</p>
845
1008
  </div>
846
1009
 
847
1010
 
@@ -867,7 +1030,7 @@
867
1030
 
868
1031
 
869
1032
 
870
- <h4 class="name" id="ftpLs"><span class="type-signature">(async) </span>ftpLs<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
1033
+ <h4 class="name" id="ls"><span class="type-signature">(async) </span>ls<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
871
1034
 
872
1035
 
873
1036
 
@@ -879,7 +1042,7 @@
879
1042
 
880
1043
  <dt class="tag-source">Source:</dt>
881
1044
  <dd class="tag-source"><ul class="dummy"><li>
882
- <a href="WFtp.mjs.html">WFtp.mjs</a>, <a href="WFtp.mjs.html#line102">line 102</a>
1045
+ <a href="WFtp.mjs.html">WFtp.mjs</a>, <a href="WFtp.mjs.html#line103">line 103</a>
883
1046
  </li></ul></dd>
884
1047
 
885
1048
 
@@ -1030,7 +1193,7 @@
1030
1193
 
1031
1194
 
1032
1195
 
1033
- <h4 class="name" id="ftpQuit"><span class="type-signature">(async) </span>ftpQuit<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
1196
+ <h4 class="name" id="quit"><span class="type-signature">(async) </span>quit<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
1034
1197
 
1035
1198
 
1036
1199
 
@@ -1042,7 +1205,7 @@
1042
1205
 
1043
1206
  <dt class="tag-source">Source:</dt>
1044
1207
  <dd class="tag-source"><ul class="dummy"><li>
1045
- <a href="WFtp.mjs.html">WFtp.mjs</a>, <a href="WFtp.mjs.html#line138">line 138</a>
1208
+ <a href="WFtp.mjs.html">WFtp.mjs</a>, <a href="WFtp.mjs.html#line139">line 139</a>
1046
1209
  </li></ul></dd>
1047
1210
 
1048
1211
 
@@ -1144,7 +1307,7 @@
1144
1307
 
1145
1308
 
1146
1309
 
1147
- <h4 class="name" id="ftpStateFile"><span class="type-signature">(async) </span>ftpStateFile<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
1310
+ <h4 class="name" id="stateFile"><span class="type-signature">(async) </span>stateFile<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
1148
1311
 
1149
1312
 
1150
1313
 
@@ -1156,7 +1319,7 @@
1156
1319
 
1157
1320
  <dt class="tag-source">Source:</dt>
1158
1321
  <dd class="tag-source"><ul class="dummy"><li>
1159
- <a href="WFtp.mjs.html">WFtp.mjs</a>, <a href="WFtp.mjs.html#line176">line 176</a>
1322
+ <a href="WFtp.mjs.html">WFtp.mjs</a>, <a href="WFtp.mjs.html#line177">line 177</a>
1160
1323
  </li></ul></dd>
1161
1324
 
1162
1325
 
@@ -1307,7 +1470,7 @@
1307
1470
 
1308
1471
 
1309
1472
 
1310
- <h4 class="name" id="ftpSyncToLocal"><span class="type-signature">(async) </span>ftpSyncToLocal<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
1473
+ <h4 class="name" id="syncToLocal"><span class="type-signature">(async) </span>syncToLocal<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
1311
1474
 
1312
1475
 
1313
1476
 
@@ -1319,7 +1482,7 @@
1319
1482
 
1320
1483
  <dt class="tag-source">Source:</dt>
1321
1484
  <dd class="tag-source"><ul class="dummy"><li>
1322
- <a href="WFtp.mjs.html">WFtp.mjs</a>, <a href="WFtp.mjs.html#line340">line 340</a>
1485
+ <a href="WFtp.mjs.html">WFtp.mjs</a>, <a href="WFtp.mjs.html#line379">line 379</a>
1323
1486
  </li></ul></dd>
1324
1487
 
1325
1488
 
@@ -1560,7 +1723,7 @@
1560
1723
 
1561
1724
 
1562
1725
 
1563
- <h4 class="name" id="ftpSyncToRemote"><span class="type-signature">(async) </span>ftpSyncToRemote<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
1726
+ <h4 class="name" id="syncToRemote"><span class="type-signature">(async) </span>syncToRemote<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
1564
1727
 
1565
1728
 
1566
1729
 
@@ -1572,7 +1735,7 @@
1572
1735
 
1573
1736
  <dt class="tag-source">Source:</dt>
1574
1737
  <dd class="tag-source"><ul class="dummy"><li>
1575
- <a href="WFtp.mjs.html">WFtp.mjs</a>, <a href="WFtp.mjs.html#line382">line 382</a>
1738
+ <a href="WFtp.mjs.html">WFtp.mjs</a>, <a href="WFtp.mjs.html#line421">line 421</a>
1576
1739
  </li></ul></dd>
1577
1740
 
1578
1741
 
@@ -1813,7 +1976,7 @@
1813
1976
 
1814
1977
 
1815
1978
 
1816
- <h4 class="name" id="ftpUpload"><span class="type-signature">(async) </span>ftpUpload<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
1979
+ <h4 class="name" id="upload"><span class="type-signature">(async) </span>upload<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
1817
1980
 
1818
1981
 
1819
1982
 
@@ -1825,7 +1988,7 @@
1825
1988
 
1826
1989
  <dt class="tag-source">Source:</dt>
1827
1990
  <dd class="tag-source"><ul class="dummy"><li>
1828
- <a href="WFtp.mjs.html">WFtp.mjs</a>, <a href="WFtp.mjs.html#line298">line 298</a>
1991
+ <a href="WFtp.mjs.html">WFtp.mjs</a>, <a href="WFtp.mjs.html#line337">line 337</a>
1829
1992
  </li></ul></dd>
1830
1993
 
1831
1994
 
@@ -2078,7 +2241,7 @@
2078
2241
 
2079
2242
  <dt class="tag-source">Source:</dt>
2080
2243
  <dd class="tag-source"><ul class="dummy"><li>
2081
- <a href="WFtp.mjs.html">WFtp.mjs</a>, <a href="WFtp.mjs.html#line518">line 518</a>
2244
+ <a href="WFtp.mjs.html">WFtp.mjs</a>, <a href="WFtp.mjs.html#line572">line 572</a>
2082
2245
  </li></ul></dd>
2083
2246
 
2084
2247
 
@@ -2131,7 +2294,7 @@
2131
2294
 
2132
2295
  <h5>Example</h5>
2133
2296
 
2134
- <pre class="prettyprint"><code>import WFtp from './src/WFtp.mjs'
2135
2297
  let r
2136
2298
  let ftp = WFtp()
2137
2299
  // console.log('ftp', ftp)
2138
2300
  await ftp.conn({
2139
2301
  hostname: `{hostname}`,
2140
2302
  port: `{port}`,
2141
2303
  username: `{username}`,
2142
2304
  password: `{password}`,
2143
2305
  })
2144
2306
  let fps = await ftp.ls('.')
2145
2307
  console.log('ftp.ls', fps[0], fps.length)
2146
2308
  r = await ftp.upload('./_test_upload_client/DECL_20210805055044.csv', './DECL_20210805055044.csv', (p) => {
2147
2309
  console.log('ftp.upload p', p.name, p.progress)
2148
2310
  })
2149
2311
  console.log('ftp.upload', r)
2150
2312
  r = await ftp.syncToRemote('./_test_upload_client', '.', (p) => {
2151
2313
  console.log('ftp.syncToRemote p', p.name, p.progress)
2152
2314
  })
2153
2315
  console.log('ftp.syncToRemote', r)
2154
2316
  r = await ftp.quit()
2155
2317
  console.log('ftp.quit', r)
2156
2318
  .catch((err) => {
2157
2319
  console.log(err)
2158
2320
  })
2159
2321
  let r
2160
2322
  let ftp = WFtp()
2161
2323
  // console.log('ftp', ftp)
2162
2324
  await ftp.conn({
2163
2325
  hostname: `{hostname}`,
2164
2326
  port: `{port}`,
2165
2327
  username: `{username}`,
2166
2328
  password: `{password}`,
2167
2329
  })
2168
2330
  let fps = await ftp.ls('.')
2169
2331
  console.log('ftp.ls', fps[0], fps.length)
2170
2332
  r = await ftp.download('./DECL_20210805055044.csv', './_test_download_client/DECL_20210805055044.csv', (p) => {
2171
2333
  console.log('ftp.download p', p.name, p.progress)
2172
2334
  })
2173
2335
  console.log('ftp.download', r)
2174
2336
  r = await ftp.syncToLocal('.', './_test_download_client', (p) => {
2175
2337
  console.log('ftp.syncToLocal p', p.name, p.progress)
2176
2338
  })
2177
2339
  console.log('ftp.syncToLocal', r)
2178
2340
  r = await ftp.quit()
2179
2341
  console.log('ftp.quit', r)
2180
2342
  .catch((err) => {
2181
2343
  console.log(err)
2182
2344
  })
2345
+ <pre class="prettyprint"><code>import WFtp from './src/WFtp.mjs'
2183
2346
  let r
2184
2347
  let ftp = WFtp()
2185
2348
  // console.log('ftp', ftp)
2186
2349
  await ftp.conn({
2187
2350
  hostname: `{hostname}`,
2188
2351
  port: `{port}`,
2189
2352
  username: `{username}`,
2190
2353
  password: `{password}`,
2191
2354
  })
2192
2355
  async function core() {
2193
2356
  let fps = await ftp.ls('.')
2194
2357
  console.log('ftp.ls', fps[0], fps.length)
2195
2358
  r = await ftp.download('./DECL_20210805055044.csv', './_test_download_client/DECL_20210805055044.csv', (p) => {
2196
2359
  console.log('ftp.download p', p.name, p.progress)
2197
2360
  })
2198
2361
  console.log('ftp.download', r)
2199
2362
  r = await ftp.syncToLocal('.', './_test_download_client', (p) => {
2200
2363
  console.log('ftp.syncToLocal p', p.name, p.progress)
2201
2364
  })
2202
2365
  console.log('ftp.syncToLocal', r)
2203
2366
  }
2204
2367
  await core()
2205
2368
  .catch((err) => {
2206
2369
  console.log(err)
2207
2370
  })
2208
2371
  r = await ftp.quit()
2209
2372
  console.log('ftp.quit', r)
2210
2373
  .catch((err) => {
2211
2374
  console.log(err)
2212
2375
  })
2213
2376
  let r
2214
2377
  let ftp = WFtp()
2215
2378
  // console.log('ftp', ftp)
2216
2379
  await ftp.conn({
2217
2380
  hostname: `{hostname}`,
2218
2381
  port: `{port}`,
2219
2382
  username: `{username}`,
2220
2383
  password: `{password}`,
2221
2384
  })
2222
2385
  async function core() {
2223
2386
  let fps = await ftp.ls('.')
2224
2387
  console.log('ftp.ls', fps[0], fps.length)
2225
2388
  r = await ftp.upload('./_test_upload_client/DECL_20210805055044.csv', './DECL_20210805055044.csv', (p) => {
2226
2389
  console.log('ftp.upload p', p.name, p.progress)
2227
2390
  })
2228
2391
  console.log('ftp.upload', r)
2229
2392
  r = await ftp.syncToRemote('./_test_upload_client', '.', (p) => {
2230
2393
  console.log('ftp.syncToRemote p', p.name, p.progress)
2231
2394
  })
2232
2395
  console.log('ftp.syncToRemote', r)
2233
2396
  }
2234
2397
  await core()
2235
2398
  .catch((err) => {
2236
2399
  console.log(err)
2237
2400
  })
2238
2401
  r = await ftp.quit()
2239
2402
  console.log('ftp.quit', r)
2240
2403
  .catch((err) => {
2241
2404
  console.log(err)
2242
2405
  })
2243
2406
 
2244
2407
 
2245
2408
 
@@ -2154,7 +2317,7 @@
2154
2317
 
2155
2318
 
2156
2319
  <div class="param-desc">
2157
- <p>回傳FTP操作物件,包含conn、ls、stateFile、checkFile、download、syncToLocal、syncToRemote、upload、quit。</p>
2320
+ <p>回傳FTP操作物件,包含conn、ls、stateFile、isFile、download、syncToLocal、syncToRemote、upload、quit。</p>
2158
2321
  </div>
2159
2322
 
2160
2323
 
@@ -2195,7 +2358,7 @@
2195
2358
  <br class="clear">
2196
2359
 
2197
2360
  <footer>
2198
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Jul 23 2022 21:57:53 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
2361
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sun Jul 24 2022 12:32:49 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
2199
2362
  </footer>
2200
2363
 
2201
2364
  <script>prettyPrint();</script>