w-data-csv 1.0.0

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.
Files changed (53) hide show
  1. package/.editorconfig +9 -0
  2. package/.eslintignore +3 -0
  3. package/.eslintrc.js +54 -0
  4. package/.jsdoc +25 -0
  5. package/README.md +54 -0
  6. package/SECURITY.md +5 -0
  7. package/babel.config.js +14 -0
  8. package/dist/w-data-csv.umd.js +7 -0
  9. package/dist/w-data-csv.umd.js.map +1 -0
  10. package/docs/WDataCsv.mjs.html +242 -0
  11. package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  12. package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  13. package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  14. package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  15. package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  16. package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  17. package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  18. package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  19. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  20. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
  21. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  22. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  23. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  24. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  25. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
  26. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  27. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  28. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  29. package/docs/global.html +787 -0
  30. package/docs/index.html +81 -0
  31. package/docs/scripts/collapse.js +20 -0
  32. package/docs/scripts/linenumber.js +25 -0
  33. package/docs/scripts/nav.js +12 -0
  34. package/docs/scripts/polyfill.js +4 -0
  35. package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
  36. package/docs/scripts/prettify/lang-css.js +2 -0
  37. package/docs/scripts/prettify/prettify.js +28 -0
  38. package/docs/scripts/search.js +83 -0
  39. package/docs/styles/jsdoc.css +765 -0
  40. package/docs/styles/prettify.css +79 -0
  41. package/g-read.mjs +15 -0
  42. package/g-test-in.csv +3 -0
  43. package/g-test-out.csv +3 -0
  44. package/g-write.mjs +16 -0
  45. package/package.json +30 -0
  46. package/src/WDataCsv.mjs +173 -0
  47. package/test/PCA.test.mjs +125 -0
  48. package/test/cluster.test.mjs +135 -0
  49. package/toolg/addVersion.mjs +4 -0
  50. package/toolg/cleanFolder.mjs +4 -0
  51. package/toolg/gDistRollup.mjs +38 -0
  52. package/toolg/gDocsExams.mjs +48 -0
  53. package/toolg/modifyReadme.mjs +4 -0
@@ -0,0 +1,787 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+
5
+ <meta charset="utf-8">
6
+ <title>Global - Documentation</title>
7
+
8
+
9
+ <script src="scripts/prettify/prettify.js"></script>
10
+ <script src="scripts/prettify/lang-css.js"></script>
11
+ <!--[if lt IE 9]>
12
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
13
+ <![endif]-->
14
+ <link type="text/css" rel="stylesheet" href="styles/prettify.css">
15
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
16
+ <script src="scripts/nav.js" defer></script>
17
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
18
+ </head>
19
+ <body>
20
+
21
+ <input type="checkbox" id="nav-trigger" class="nav-trigger" />
22
+ <label for="nav-trigger" class="navicon-button x">
23
+ <div class="navicon"></div>
24
+ </label>
25
+
26
+ <label for="nav-trigger" class="overlay"></label>
27
+
28
+ <nav >
29
+
30
+ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#readCsv">readCsv</a></li><li><a href="global.html#WDataCsv">WDataCsv</a></li><li><a href="global.html#writeCsv">writeCsv</a></li></ul>
31
+ </nav>
32
+
33
+ <div id="main">
34
+
35
+ <h1 class="page-title">Global</h1>
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+ <section>
44
+
45
+ <header>
46
+
47
+ <h2>
48
+
49
+ </h2>
50
+
51
+
52
+ </header>
53
+
54
+ <article>
55
+
56
+ <div class="container-overview">
57
+
58
+
59
+
60
+ <dl class="details">
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+ </dl>
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+ </div>
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+ <h3 class="subsection-title">Members</h3>
119
+
120
+
121
+
122
+ <h4 class="name" id="WDataCsv"><span class="type-signature"></span>WDataCsv<span class="type-signature"></span></h4>
123
+
124
+
125
+
126
+
127
+
128
+ <dl class="details">
129
+
130
+
131
+ <dt class="tag-source">Source:</dt>
132
+ <dd class="tag-source"><ul class="dummy"><li>
133
+ <a href="WDataCsv.mjs.html">WDataCsv.mjs</a>, <a href="WDataCsv.mjs.html#line167">line 167</a>
134
+ </li></ul></dd>
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+ </dl>
167
+
168
+
169
+
170
+
171
+
172
+ <div class="description usertext">
173
+ <p>讀寫CSV檔</p>
174
+ </div>
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+ <h5>Example</h5>
183
+
184
+ <pre class="prettyprint"><code>import wdc from './src/WDataCsv.mjs'
185
  .then((ltdtIn) => {
1
186
  console.log(ltdtIn)
2
187
  // => [ { NAME: 'Daffy Duck', AGE: '24' }, { NAME: 'Bugs 邦妮', AGE: '22' } ]
3
188
  })
4
189
  .catch((err) => {
5
190
  console.log(err)
6
191
  })
7
192
  .then((res) => {
8
193
  console.log(res)
9
194
  // => finish
10
195
  })
11
196
  .catch((err) => {
12
197
  console.log(err)
13
198
  })</code></pre>
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+ <h3 class="subsection-title">Methods</h3>
207
+
208
+
209
+
210
+
211
+
212
+
213
+ <h4 class="name" id="readCsv"><span class="type-signature">(async) </span>readCsv<span class="signature">(fp)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
214
+
215
+
216
+
217
+
218
+
219
+
220
+ <dl class="details">
221
+
222
+
223
+ <dt class="tag-source">Source:</dt>
224
+ <dd class="tag-source"><ul class="dummy"><li>
225
+ <a href="WDataCsv.mjs.html">WDataCsv.mjs</a>, <a href="WDataCsv.mjs.html#line30">line 30</a>
226
+ </li></ul></dd>
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+
252
+
253
+
254
+
255
+
256
+
257
+
258
+ </dl>
259
+
260
+
261
+
262
+
263
+
264
+ <div class="description usertext">
265
+ <p>讀取CSV檔,自動清除BOM</p>
266
+ </div>
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+ <h5>Example</h5>
277
+
278
+ <pre class="prettyprint"><code>import wdc from './src/WDataCsv.mjs'
14
279
  .then((ltdt) => {
15
280
  console.log(ltdt)
16
281
  // => [ { NAME: 'Daffy Duck', AGE: '24' }, { NAME: 'Bugs 邦妮', AGE: '22' } ]
17
282
  })
18
283
  .catch((err) => {
19
284
  console.log(err)
20
285
  })</code></pre>
286
+
287
+
288
+
289
+
290
+ <h5>Parameters:</h5>
291
+
292
+
293
+ <table class="params">
294
+ <thead>
295
+ <tr>
296
+
297
+ <th>Name</th>
298
+
299
+
300
+ <th>Type</th>
301
+
302
+
303
+
304
+
305
+
306
+ <th class="last">Description</th>
307
+ </tr>
308
+ </thead>
309
+
310
+ <tbody>
311
+
312
+
313
+ <tr>
314
+
315
+ <td class="name"><code>fp</code></td>
316
+
317
+
318
+ <td class="type">
319
+
320
+
321
+ <span class="param-type">String</span>
322
+
323
+
324
+
325
+ </td>
326
+
327
+
328
+
329
+
330
+
331
+ <td class="description last"><p>輸入檔案位置字串</p></td>
332
+ </tr>
333
+
334
+
335
+ </tbody>
336
+ </table>
337
+
338
+
339
+
340
+
341
+
342
+
343
+
344
+
345
+
346
+
347
+
348
+
349
+
350
+
351
+
352
+
353
+ <h5>Returns:</h5>
354
+
355
+
356
+ <div class="param-desc">
357
+ <p>回傳Promise,resolve回傳ltdt(各數據列為物件陣列),reject回傳錯誤訊息</p>
358
+ </div>
359
+
360
+
361
+
362
+ <dl class="param-type">
363
+ <dt>
364
+ Type
365
+ </dt>
366
+ <dd>
367
+
368
+ <span class="param-type">Promise</span>
369
+
370
+
371
+ </dd>
372
+ </dl>
373
+
374
+
375
+
376
+
377
+
378
+
379
+
380
+
381
+
382
+
383
+ <h4 class="name" id="writeCsv"><span class="type-signature">(async) </span>writeCsv<span class="signature">(fp, data, opt<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
384
+
385
+
386
+
387
+
388
+
389
+
390
+ <dl class="details">
391
+
392
+
393
+ <dt class="tag-source">Source:</dt>
394
+ <dd class="tag-source"><ul class="dummy"><li>
395
+ <a href="WDataCsv.mjs.html">WDataCsv.mjs</a>, <a href="WDataCsv.mjs.html#line76">line 76</a>
396
+ </li></ul></dd>
397
+
398
+
399
+
400
+
401
+
402
+
403
+
404
+
405
+
406
+
407
+
408
+
409
+
410
+
411
+
412
+
413
+
414
+
415
+
416
+
417
+
418
+
419
+
420
+
421
+
422
+
423
+
424
+
425
+
426
+
427
+
428
+ </dl>
429
+
430
+
431
+
432
+
433
+
434
+ <div class="description usertext">
435
+ <p>輸出數據至CSV檔案</p>
436
+ </div>
437
+
438
+
439
+
440
+
441
+
442
+
443
+
444
+
445
+
446
+ <h5>Example</h5>
447
+
448
+ <pre class="prettyprint"><code>import wdc from './src/WDataCsv.mjs'
21
449
  .then((res) => {
22
450
  console.log(res)
23
451
  // => finish
24
452
  })
25
453
  .catch((err) => {
26
454
  console.log(err)
27
455
  })</code></pre>
456
+
457
+
458
+
459
+
460
+ <h5>Parameters:</h5>
461
+
462
+
463
+ <table class="params">
464
+ <thead>
465
+ <tr>
466
+
467
+ <th>Name</th>
468
+
469
+
470
+ <th>Type</th>
471
+
472
+
473
+ <th>Attributes</th>
474
+
475
+
476
+
477
+ <th>Default</th>
478
+
479
+
480
+ <th class="last">Description</th>
481
+ </tr>
482
+ </thead>
483
+
484
+ <tbody>
485
+
486
+
487
+ <tr>
488
+
489
+ <td class="name"><code>fp</code></td>
490
+
491
+
492
+ <td class="type">
493
+
494
+
495
+ <span class="param-type">String</span>
496
+
497
+
498
+
499
+ </td>
500
+
501
+
502
+ <td class="attributes">
503
+
504
+
505
+
506
+
507
+
508
+ </td>
509
+
510
+
511
+
512
+ <td class="default">
513
+
514
+ </td>
515
+
516
+
517
+ <td class="description last"><p>輸入檔案位置字串</p></td>
518
+ </tr>
519
+
520
+
521
+
522
+ <tr>
523
+
524
+ <td class="name"><code>data</code></td>
525
+
526
+
527
+ <td class="type">
528
+
529
+
530
+ <span class="param-type">Array</span>
531
+
532
+
533
+
534
+ </td>
535
+
536
+
537
+ <td class="attributes">
538
+
539
+
540
+
541
+
542
+
543
+ </td>
544
+
545
+
546
+
547
+ <td class="default">
548
+
549
+ </td>
550
+
551
+
552
+ <td class="description last"><p>輸入數據陣列,為mat或ltdt格式</p></td>
553
+ </tr>
554
+
555
+
556
+
557
+ <tr>
558
+
559
+ <td class="name"><code>opt</code></td>
560
+
561
+
562
+ <td class="type">
563
+
564
+
565
+ <span class="param-type">Object</span>
566
+
567
+
568
+
569
+ </td>
570
+
571
+
572
+ <td class="attributes">
573
+
574
+ &lt;optional><br>
575
+
576
+
577
+
578
+
579
+
580
+ </td>
581
+
582
+
583
+
584
+ <td class="default">
585
+
586
+ <code>{}</code>
587
+
588
+ </td>
589
+
590
+
591
+ <td class="description last"><p>輸入設定物件,預設{}</p>
592
+ <h6>Properties</h6>
593
+
594
+
595
+ <table class="params">
596
+ <thead>
597
+ <tr>
598
+
599
+ <th>Name</th>
600
+
601
+
602
+ <th>Type</th>
603
+
604
+
605
+ <th>Attributes</th>
606
+
607
+
608
+
609
+ <th>Default</th>
610
+
611
+
612
+ <th class="last">Description</th>
613
+ </tr>
614
+ </thead>
615
+
616
+ <tbody>
617
+
618
+
619
+ <tr>
620
+
621
+ <td class="name"><code>mode</code></td>
622
+
623
+
624
+ <td class="type">
625
+
626
+
627
+ <span class="param-type">String</span>
628
+
629
+
630
+
631
+ </td>
632
+
633
+
634
+ <td class="attributes">
635
+
636
+ &lt;optional><br>
637
+
638
+
639
+
640
+
641
+
642
+ </td>
643
+
644
+
645
+
646
+ <td class="default">
647
+
648
+ <code>'ltdt'</code>
649
+
650
+ </td>
651
+
652
+
653
+ <td class="description last"><p>輸入數據格式字串,可選ltdt或mat,預設ltdt</p></td>
654
+ </tr>
655
+
656
+
657
+
658
+ <tr>
659
+
660
+ <td class="name"><code>keys</code></td>
661
+
662
+
663
+ <td class="type">
664
+
665
+
666
+ <span class="param-type">Array</span>
667
+
668
+
669
+
670
+ </td>
671
+
672
+
673
+ <td class="attributes">
674
+
675
+ &lt;optional><br>
676
+
677
+
678
+
679
+
680
+
681
+ </td>
682
+
683
+
684
+
685
+ <td class="default">
686
+
687
+ <code>[]</code>
688
+
689
+ </td>
690
+
691
+
692
+ <td class="description last"><p>輸入指定欲輸出鍵值陣列,預設[]</p></td>
693
+ </tr>
694
+
695
+
696
+
697
+ <tr>
698
+
699
+ <td class="name"><code>kphead</code></td>
700
+
701
+
702
+ <td class="type">
703
+
704
+
705
+ <span class="param-type">Object</span>
706
+
707
+
708
+
709
+ </td>
710
+
711
+
712
+ <td class="attributes">
713
+
714
+ &lt;optional><br>
715
+
716
+
717
+
718
+
719
+
720
+ </td>
721
+
722
+
723
+
724
+ <td class="default">
725
+
726
+ <code>{}</code>
727
+
728
+ </td>
729
+
730
+
731
+ <td class="description last"><p>輸入指定鍵值轉換物件,預設{}</p></td>
732
+ </tr>
733
+
734
+
735
+ </tbody>
736
+ </table>
737
+
738
+ </td>
739
+ </tr>
740
+
741
+
742
+ </tbody>
743
+ </table>
744
+
745
+
746
+
747
+
748
+
749
+
750
+
751
+
752
+
753
+
754
+
755
+
756
+
757
+
758
+
759
+
760
+ <h5>Returns:</h5>
761
+
762
+
763
+ <div class="param-desc">
764
+ <p>回傳Promise,resolve回傳成功訊息,reject回傳錯誤訊息</p>
765
+ </div>
766
+
767
+
768
+
769
+ <dl class="param-type">
770
+ <dt>
771
+ Type
772
+ </dt>
773
+ <dd>
774
+
775
+ <span class="param-type">Promise</span>
776
+
777
+
778
+ </dd>
779
+ </dl>
780
+
781
+
782
+
783
+
784
+
785
+
786
+
787
+
788
+
789
+
790
+
791
+ </article>
792
+
793
+ </section>
794
+
795
+
796
+
797
+
798
+
799
+
800
+ </div>
801
+
802
+ <br class="clear">
803
+
804
+ <footer>
805
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Tue Apr 26 2022 11:57:37 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
806
+ </footer>
807
+
808
+ <script>prettyPrint();</script>
809
+ <script src="scripts/polyfill.js"></script>
810
+ <script src="scripts/linenumber.js"></script>
811
+
812
+
813
+
814
+ </body>
815
+ </html>