convert-csv-to-json 4.1.0 → 4.3.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 (61) hide show
  1. package/.eslintignore +3 -0
  2. package/.eslintrc.json +48 -0
  3. package/.github/workflows/ci-cd.yml +28 -2
  4. package/SECURITY.md +2 -0
  5. package/docs/api/BrowserApi.html +2435 -0
  6. package/docs/api/BrowserApiError.html +522 -0
  7. package/docs/api/ConfigurationError.html +594 -0
  8. package/docs/api/CsvFormatError.html +530 -0
  9. package/docs/api/CsvParsingError.html +384 -0
  10. package/docs/api/CsvToJson.html +3136 -0
  11. package/docs/api/CsvToJsonAsync.html +2672 -0
  12. package/docs/api/FileOperationError.html +270 -0
  13. package/docs/api/FileUtils.html +1012 -0
  14. package/docs/api/InputValidationError.html +293 -0
  15. package/docs/api/JsonUtil.html +340 -0
  16. package/docs/api/JsonValidationError.html +247 -0
  17. package/docs/api/fonts/OpenSans-Bold-webfont.eot +0 -0
  18. package/docs/api/fonts/OpenSans-Bold-webfont.svg +1830 -0
  19. package/docs/api/fonts/OpenSans-Bold-webfont.woff +0 -0
  20. package/docs/api/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  21. package/docs/api/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
  22. package/docs/api/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  23. package/docs/api/fonts/OpenSans-Italic-webfont.eot +0 -0
  24. package/docs/api/fonts/OpenSans-Italic-webfont.svg +1830 -0
  25. package/docs/api/fonts/OpenSans-Italic-webfont.woff +0 -0
  26. package/docs/api/fonts/OpenSans-Light-webfont.eot +0 -0
  27. package/docs/api/fonts/OpenSans-Light-webfont.svg +1831 -0
  28. package/docs/api/fonts/OpenSans-Light-webfont.woff +0 -0
  29. package/docs/api/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  30. package/docs/api/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
  31. package/docs/api/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  32. package/docs/api/fonts/OpenSans-Regular-webfont.eot +0 -0
  33. package/docs/api/fonts/OpenSans-Regular-webfont.svg +1831 -0
  34. package/docs/api/fonts/OpenSans-Regular-webfont.woff +0 -0
  35. package/docs/api/global.html +3315 -0
  36. package/docs/api/index.html +326 -0
  37. package/docs/api/index.js.html +341 -0
  38. package/docs/api/scripts/linenumber.js +25 -0
  39. package/docs/api/scripts/prettify/Apache-License-2.0.txt +202 -0
  40. package/docs/api/scripts/prettify/lang-css.js +2 -0
  41. package/docs/api/scripts/prettify/prettify.js +28 -0
  42. package/docs/api/src_browserApi.js.html +271 -0
  43. package/docs/api/src_csvToJson.js.html +605 -0
  44. package/docs/api/src_csvToJsonAsync.js.html +244 -0
  45. package/docs/api/src_util_errors.js.html +374 -0
  46. package/docs/api/src_util_fileUtils.js.html +147 -0
  47. package/docs/api/src_util_jsonUtils.js.html +75 -0
  48. package/docs/api/src_util_stringUtils.js.html +212 -0
  49. package/docs/api/styles/jsdoc-default.css +358 -0
  50. package/docs/api/styles/prettify-jsdoc.css +111 -0
  51. package/docs/api/styles/prettify-tomorrow.css +132 -0
  52. package/index.js +109 -32
  53. package/jsdoc.json +17 -0
  54. package/package.json +10 -3
  55. package/src/browserApi.js +96 -4
  56. package/src/csvToJson.js +163 -2
  57. package/src/csvToJsonAsync.js +74 -14
  58. package/src/util/errors.js +96 -0
  59. package/src/util/fileUtils.js +34 -0
  60. package/src/util/jsonUtils.js +8 -0
  61. package/src/util/stringUtils.js +51 -0
@@ -0,0 +1,2672 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>JSDoc: Class: CsvToJsonAsync</title>
6
+
7
+ <script src="scripts/prettify/prettify.js"> </script>
8
+ <script src="scripts/prettify/lang-css.js"> </script>
9
+ <!--[if lt IE 9]>
10
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11
+ <![endif]-->
12
+ <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
14
+ </head>
15
+
16
+ <body>
17
+
18
+ <div id="main">
19
+
20
+ <h1 class="page-title">Class: CsvToJsonAsync</h1>
21
+
22
+
23
+
24
+
25
+
26
+
27
+ <section>
28
+
29
+ <header>
30
+
31
+ <h2><span class="attribs"><span class="type-signature"></span></span>CsvToJsonAsync<span class="signature">()</span><span class="type-signature"></span></h2>
32
+
33
+ <div class="class-description"><p>Asynchronous CSV to JSON converter
34
+ Proxies configuration to sync instance but provides async file I/O methods</p></div>
35
+
36
+
37
+ </header>
38
+
39
+ <article>
40
+ <div class="container-overview">
41
+
42
+
43
+
44
+
45
+ <h2>Constructor</h2>
46
+
47
+
48
+
49
+ <h4 class="name" id="CsvToJsonAsync"><span class="type-signature"></span>new CsvToJsonAsync<span class="signature">()</span><span class="type-signature"></span></h4>
50
+
51
+
52
+
53
+
54
+
55
+
56
+ <div class="description">
57
+ <p>Constructor initializes proxy to sync csvToJson instance</p>
58
+ </div>
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+ <dl class="details">
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+ <dt class="tag-source">Source:</dt>
100
+ <dd class="tag-source"><ul class="dummy"><li>
101
+ <a href="src_csvToJsonAsync.js.html">src/csvToJsonAsync.js</a>, <a href="src_csvToJsonAsync.js.html#line12">line 12</a>
102
+ </li></ul></dd>
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+ </dl>
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+ </div>
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+ <h3 class="subsection-title">Methods</h3>
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+ <h4 class="name" id="csvStringToJsonAsync"><span class="type-signature"></span>csvStringToJsonAsync<span class="signature">(csvString, options)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;object>>}</span></h4>
158
+
159
+
160
+
161
+
162
+
163
+
164
+ <div class="description">
165
+ <p>Parse CSV string to JSON array (async)</p>
166
+ </div>
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+ <h5>Parameters:</h5>
177
+
178
+
179
+ <table class="params">
180
+ <thead>
181
+ <tr>
182
+
183
+ <th>Name</th>
184
+
185
+
186
+ <th>Type</th>
187
+
188
+
189
+
190
+
191
+
192
+ <th class="last">Description</th>
193
+ </tr>
194
+ </thead>
195
+
196
+ <tbody>
197
+
198
+
199
+ <tr>
200
+
201
+ <td class="name"><code>csvString</code></td>
202
+
203
+
204
+ <td class="type">
205
+
206
+
207
+ <span class="param-type">string</span>
208
+
209
+
210
+
211
+ </td>
212
+
213
+
214
+
215
+
216
+
217
+ <td class="description last"><p>CSV content as string</p></td>
218
+ </tr>
219
+
220
+
221
+
222
+ <tr>
223
+
224
+ <td class="name"><code>options</code></td>
225
+
226
+
227
+ <td class="type">
228
+
229
+
230
+ <span class="param-type">object</span>
231
+
232
+
233
+
234
+ </td>
235
+
236
+
237
+
238
+
239
+
240
+ <td class="description last"><p>Configuration options (default: { raw: true })</p></td>
241
+ </tr>
242
+
243
+
244
+ </tbody>
245
+ </table>
246
+
247
+
248
+
249
+
250
+
251
+
252
+ <dl class="details">
253
+
254
+
255
+
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+
279
+ <dt class="tag-source">Source:</dt>
280
+ <dd class="tag-source"><ul class="dummy"><li>
281
+ <a href="src_csvToJsonAsync.js.html">src/csvToJsonAsync.js</a>, <a href="src_csvToJsonAsync.js.html#line174">line 174</a>
282
+ </li></ul></dd>
283
+
284
+
285
+
286
+
287
+
288
+
289
+
290
+ </dl>
291
+
292
+
293
+
294
+
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+
303
+
304
+ <h5>Throws:</h5>
305
+
306
+
307
+
308
+ <dl>
309
+ <dt>
310
+ <div class="param-desc">
311
+ <p>If CSV is malformed</p>
312
+ </div>
313
+ </dt>
314
+ <dd></dd>
315
+ <dt>
316
+ <dl>
317
+ <dt>
318
+ Type
319
+ </dt>
320
+ <dd>
321
+
322
+ <span class="param-type"><a href="CsvFormatError.html">CsvFormatError</a></span>
323
+
324
+
325
+ </dd>
326
+ </dl>
327
+ </dt>
328
+ <dd></dd>
329
+ </dl>
330
+
331
+
332
+
333
+
334
+
335
+ <h5>Returns:</h5>
336
+
337
+
338
+ <div class="param-desc">
339
+ <p>Array of objects representing CSV rows</p>
340
+ </div>
341
+
342
+
343
+
344
+ <dl>
345
+ <dt>
346
+ Type
347
+ </dt>
348
+ <dd>
349
+
350
+ <span class="param-type">Promise.&lt;Array.&lt;object>></span>
351
+
352
+
353
+ </dd>
354
+ </dl>
355
+
356
+
357
+
358
+
359
+
360
+
361
+ <h5>Example</h5>
362
+
363
+ <pre class="prettyprint"><code>const csvToJson = require('convert-csv-to-json');
364
+ const data = await csvToJson.csvStringToJsonAsync('name,age\nAlice,30');
365
+ console.log(data);</code></pre>
366
+
367
+
368
+
369
+
370
+
371
+
372
+
373
+
374
+
375
+ <h4 class="name" id="csvStringToJsonStringifiedAsync"><span class="type-signature">(async) </span>csvStringToJsonStringifiedAsync<span class="signature">(csvString)</span><span class="type-signature"> &rarr; {Promise.&lt;string>}</span></h4>
376
+
377
+
378
+
379
+
380
+
381
+
382
+ <div class="description">
383
+ <p>Parse CSV string to stringified JSON (async)</p>
384
+ </div>
385
+
386
+
387
+
388
+
389
+
390
+
391
+
392
+
393
+
394
+ <h5>Parameters:</h5>
395
+
396
+
397
+ <table class="params">
398
+ <thead>
399
+ <tr>
400
+
401
+ <th>Name</th>
402
+
403
+
404
+ <th>Type</th>
405
+
406
+
407
+
408
+
409
+
410
+ <th class="last">Description</th>
411
+ </tr>
412
+ </thead>
413
+
414
+ <tbody>
415
+
416
+
417
+ <tr>
418
+
419
+ <td class="name"><code>csvString</code></td>
420
+
421
+
422
+ <td class="type">
423
+
424
+
425
+ <span class="param-type">string</span>
426
+
427
+
428
+
429
+ </td>
430
+
431
+
432
+
433
+
434
+
435
+ <td class="description last"><p>CSV content as string</p></td>
436
+ </tr>
437
+
438
+
439
+ </tbody>
440
+ </table>
441
+
442
+
443
+
444
+
445
+
446
+
447
+ <dl class="details">
448
+
449
+
450
+
451
+
452
+
453
+
454
+
455
+
456
+
457
+
458
+
459
+
460
+
461
+
462
+
463
+
464
+
465
+
466
+
467
+
468
+
469
+
470
+
471
+
472
+
473
+
474
+ <dt class="tag-source">Source:</dt>
475
+ <dd class="tag-source"><ul class="dummy"><li>
476
+ <a href="src_csvToJsonAsync.js.html">src/csvToJsonAsync.js</a>, <a href="src_csvToJsonAsync.js.html#line188">line 188</a>
477
+ </li></ul></dd>
478
+
479
+
480
+
481
+
482
+
483
+
484
+
485
+ </dl>
486
+
487
+
488
+
489
+
490
+
491
+
492
+
493
+
494
+
495
+
496
+
497
+
498
+
499
+ <h5>Throws:</h5>
500
+
501
+
502
+
503
+ <dl>
504
+ <dt>
505
+ <div class="param-desc">
506
+ <p>If CSV is malformed</p>
507
+ </div>
508
+ </dt>
509
+ <dd></dd>
510
+ <dt>
511
+ <dl>
512
+ <dt>
513
+ Type
514
+ </dt>
515
+ <dd>
516
+
517
+ <span class="param-type"><a href="CsvFormatError.html">CsvFormatError</a></span>
518
+
519
+
520
+ </dd>
521
+ </dl>
522
+ </dt>
523
+ <dd></dd>
524
+ </dl>
525
+
526
+
527
+
528
+
529
+
530
+ <h5>Returns:</h5>
531
+
532
+
533
+ <div class="param-desc">
534
+ <p>JSON stringified array of objects</p>
535
+ </div>
536
+
537
+
538
+
539
+ <dl>
540
+ <dt>
541
+ Type
542
+ </dt>
543
+ <dd>
544
+
545
+ <span class="param-type">Promise.&lt;string></span>
546
+
547
+
548
+ </dd>
549
+ </dl>
550
+
551
+
552
+
553
+
554
+
555
+
556
+ <h5>Example</h5>
557
+
558
+ <pre class="prettyprint"><code>const csvToJson = require('convert-csv-to-json');
559
+ const jsonString = await csvToJson.csvStringToJsonStringifiedAsync('name,age\nAlice,30');
560
+ console.log(jsonString);</code></pre>
561
+
562
+
563
+
564
+
565
+
566
+
567
+
568
+
569
+
570
+ <h4 class="name" id="encoding"><span class="type-signature"></span>encoding<span class="signature">(encoding)</span><span class="type-signature"> &rarr; {this}</span></h4>
571
+
572
+
573
+
574
+
575
+
576
+
577
+ <div class="description">
578
+ <p>Set file encoding for reading CSV files</p>
579
+ </div>
580
+
581
+
582
+
583
+
584
+
585
+
586
+
587
+
588
+
589
+ <h5>Parameters:</h5>
590
+
591
+
592
+ <table class="params">
593
+ <thead>
594
+ <tr>
595
+
596
+ <th>Name</th>
597
+
598
+
599
+ <th>Type</th>
600
+
601
+
602
+
603
+
604
+
605
+ <th class="last">Description</th>
606
+ </tr>
607
+ </thead>
608
+
609
+ <tbody>
610
+
611
+
612
+ <tr>
613
+
614
+ <td class="name"><code>encoding</code></td>
615
+
616
+
617
+ <td class="type">
618
+
619
+
620
+ <span class="param-type">string</span>
621
+
622
+
623
+
624
+ </td>
625
+
626
+
627
+
628
+
629
+
630
+ <td class="description last"><p>Node.js supported encoding (e.g., 'utf8', 'latin1')</p></td>
631
+ </tr>
632
+
633
+
634
+ </tbody>
635
+ </table>
636
+
637
+
638
+
639
+
640
+
641
+
642
+ <dl class="details">
643
+
644
+
645
+
646
+
647
+
648
+
649
+
650
+
651
+
652
+
653
+
654
+
655
+
656
+
657
+
658
+
659
+
660
+
661
+
662
+
663
+
664
+
665
+
666
+
667
+
668
+
669
+ <dt class="tag-source">Source:</dt>
670
+ <dd class="tag-source"><ul class="dummy"><li>
671
+ <a href="src_csvToJsonAsync.js.html">src/csvToJsonAsync.js</a>, <a href="src_csvToJsonAsync.js.html#line97">line 97</a>
672
+ </li></ul></dd>
673
+
674
+
675
+
676
+
677
+
678
+
679
+
680
+ </dl>
681
+
682
+
683
+
684
+
685
+
686
+
687
+
688
+
689
+
690
+
691
+
692
+
693
+
694
+
695
+
696
+ <h5>Returns:</h5>
697
+
698
+
699
+ <div class="param-desc">
700
+ <p>For method chaining</p>
701
+ </div>
702
+
703
+
704
+
705
+ <dl>
706
+ <dt>
707
+ Type
708
+ </dt>
709
+ <dd>
710
+
711
+ <span class="param-type">this</span>
712
+
713
+
714
+ </dd>
715
+ </dl>
716
+
717
+
718
+
719
+
720
+
721
+
722
+
723
+
724
+
725
+
726
+
727
+
728
+
729
+ <h4 class="name" id="fieldDelimiter"><span class="type-signature"></span>fieldDelimiter<span class="signature">(delimiter)</span><span class="type-signature"> &rarr; {this}</span></h4>
730
+
731
+
732
+
733
+
734
+
735
+
736
+ <div class="description">
737
+ <p>Set the field delimiter character</p>
738
+ </div>
739
+
740
+
741
+
742
+
743
+
744
+
745
+
746
+
747
+
748
+ <h5>Parameters:</h5>
749
+
750
+
751
+ <table class="params">
752
+ <thead>
753
+ <tr>
754
+
755
+ <th>Name</th>
756
+
757
+
758
+ <th>Type</th>
759
+
760
+
761
+
762
+
763
+
764
+ <th class="last">Description</th>
765
+ </tr>
766
+ </thead>
767
+
768
+ <tbody>
769
+
770
+
771
+ <tr>
772
+
773
+ <td class="name"><code>delimiter</code></td>
774
+
775
+
776
+ <td class="type">
777
+
778
+
779
+ <span class="param-type">string</span>
780
+
781
+
782
+
783
+ </td>
784
+
785
+
786
+
787
+
788
+
789
+ <td class="description last"><p>Character(s) to use as field separator</p></td>
790
+ </tr>
791
+
792
+
793
+ </tbody>
794
+ </table>
795
+
796
+
797
+
798
+
799
+
800
+
801
+ <dl class="details">
802
+
803
+
804
+
805
+
806
+
807
+
808
+
809
+
810
+
811
+
812
+
813
+
814
+
815
+
816
+
817
+
818
+
819
+
820
+
821
+
822
+
823
+
824
+
825
+
826
+
827
+
828
+ <dt class="tag-source">Source:</dt>
829
+ <dd class="tag-source"><ul class="dummy"><li>
830
+ <a href="src_csvToJsonAsync.js.html">src/csvToJsonAsync.js</a>, <a href="src_csvToJsonAsync.js.html#line46">line 46</a>
831
+ </li></ul></dd>
832
+
833
+
834
+
835
+
836
+
837
+
838
+
839
+ </dl>
840
+
841
+
842
+
843
+
844
+
845
+
846
+
847
+
848
+
849
+
850
+
851
+
852
+
853
+
854
+
855
+ <h5>Returns:</h5>
856
+
857
+
858
+ <div class="param-desc">
859
+ <p>For method chaining</p>
860
+ </div>
861
+
862
+
863
+
864
+ <dl>
865
+ <dt>
866
+ Type
867
+ </dt>
868
+ <dd>
869
+
870
+ <span class="param-type">this</span>
871
+
872
+
873
+ </dd>
874
+ </dl>
875
+
876
+
877
+
878
+
879
+
880
+
881
+
882
+
883
+
884
+
885
+
886
+
887
+
888
+ <h4 class="name" id="formatValueByType"><span class="type-signature"></span>formatValueByType<span class="signature">(active)</span><span class="type-signature"> &rarr; {this}</span></h4>
889
+
890
+
891
+
892
+
893
+
894
+
895
+ <div class="description">
896
+ <p>Enable or disable automatic type formatting for values</p>
897
+ </div>
898
+
899
+
900
+
901
+
902
+
903
+
904
+
905
+
906
+
907
+ <h5>Parameters:</h5>
908
+
909
+
910
+ <table class="params">
911
+ <thead>
912
+ <tr>
913
+
914
+ <th>Name</th>
915
+
916
+
917
+ <th>Type</th>
918
+
919
+
920
+
921
+
922
+
923
+ <th class="last">Description</th>
924
+ </tr>
925
+ </thead>
926
+
927
+ <tbody>
928
+
929
+
930
+ <tr>
931
+
932
+ <td class="name"><code>active</code></td>
933
+
934
+
935
+ <td class="type">
936
+
937
+
938
+ <span class="param-type">boolean</span>
939
+
940
+
941
+
942
+ </td>
943
+
944
+
945
+
946
+
947
+
948
+ <td class="description last"><p>Whether to format values by type</p></td>
949
+ </tr>
950
+
951
+
952
+ </tbody>
953
+ </table>
954
+
955
+
956
+
957
+
958
+
959
+
960
+ <dl class="details">
961
+
962
+
963
+
964
+
965
+
966
+
967
+
968
+
969
+
970
+
971
+
972
+
973
+
974
+
975
+
976
+
977
+
978
+
979
+
980
+
981
+
982
+
983
+
984
+
985
+
986
+
987
+ <dt class="tag-source">Source:</dt>
988
+ <dd class="tag-source"><ul class="dummy"><li>
989
+ <a href="src_csvToJsonAsync.js.html">src/csvToJsonAsync.js</a>, <a href="src_csvToJsonAsync.js.html#line26">line 26</a>
990
+ </li></ul></dd>
991
+
992
+
993
+
994
+
995
+
996
+
997
+
998
+ </dl>
999
+
1000
+
1001
+
1002
+
1003
+
1004
+
1005
+
1006
+
1007
+
1008
+
1009
+
1010
+
1011
+
1012
+
1013
+
1014
+ <h5>Returns:</h5>
1015
+
1016
+
1017
+ <div class="param-desc">
1018
+ <p>For method chaining</p>
1019
+ </div>
1020
+
1021
+
1022
+
1023
+ <dl>
1024
+ <dt>
1025
+ Type
1026
+ </dt>
1027
+ <dd>
1028
+
1029
+ <span class="param-type">this</span>
1030
+
1031
+
1032
+ </dd>
1033
+ </dl>
1034
+
1035
+
1036
+
1037
+
1038
+
1039
+
1040
+
1041
+
1042
+
1043
+
1044
+
1045
+
1046
+
1047
+ <h4 class="name" id="generateJsonFileFromCsv"><span class="type-signature">(async) </span>generateJsonFileFromCsv<span class="signature">(fileInputName, fileOutputName)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4>
1048
+
1049
+
1050
+
1051
+
1052
+
1053
+
1054
+ <div class="description">
1055
+ <p>Read a CSV file and write parsed JSON to an output file (async)</p>
1056
+ </div>
1057
+
1058
+
1059
+
1060
+
1061
+
1062
+
1063
+
1064
+
1065
+
1066
+ <h5>Parameters:</h5>
1067
+
1068
+
1069
+ <table class="params">
1070
+ <thead>
1071
+ <tr>
1072
+
1073
+ <th>Name</th>
1074
+
1075
+
1076
+ <th>Type</th>
1077
+
1078
+
1079
+
1080
+
1081
+
1082
+ <th class="last">Description</th>
1083
+ </tr>
1084
+ </thead>
1085
+
1086
+ <tbody>
1087
+
1088
+
1089
+ <tr>
1090
+
1091
+ <td class="name"><code>fileInputName</code></td>
1092
+
1093
+
1094
+ <td class="type">
1095
+
1096
+
1097
+ <span class="param-type">string</span>
1098
+
1099
+
1100
+
1101
+ </td>
1102
+
1103
+
1104
+
1105
+
1106
+
1107
+ <td class="description last"><p>Path to input CSV file</p></td>
1108
+ </tr>
1109
+
1110
+
1111
+
1112
+ <tr>
1113
+
1114
+ <td class="name"><code>fileOutputName</code></td>
1115
+
1116
+
1117
+ <td class="type">
1118
+
1119
+
1120
+ <span class="param-type">string</span>
1121
+
1122
+
1123
+
1124
+ </td>
1125
+
1126
+
1127
+
1128
+
1129
+
1130
+ <td class="description last"><p>Path to output JSON file</p></td>
1131
+ </tr>
1132
+
1133
+
1134
+ </tbody>
1135
+ </table>
1136
+
1137
+
1138
+
1139
+
1140
+
1141
+
1142
+ <dl class="details">
1143
+
1144
+
1145
+
1146
+
1147
+
1148
+
1149
+
1150
+
1151
+
1152
+
1153
+
1154
+
1155
+
1156
+
1157
+
1158
+
1159
+
1160
+
1161
+
1162
+
1163
+
1164
+
1165
+
1166
+
1167
+
1168
+
1169
+ <dt class="tag-source">Source:</dt>
1170
+ <dd class="tag-source"><ul class="dummy"><li>
1171
+ <a href="src_csvToJsonAsync.js.html">src/csvToJsonAsync.js</a>, <a href="src_csvToJsonAsync.js.html#line110">line 110</a>
1172
+ </li></ul></dd>
1173
+
1174
+
1175
+
1176
+
1177
+
1178
+
1179
+
1180
+ </dl>
1181
+
1182
+
1183
+
1184
+
1185
+
1186
+
1187
+
1188
+
1189
+
1190
+
1191
+
1192
+
1193
+
1194
+ <h5>Throws:</h5>
1195
+ <ul>
1196
+ <li>
1197
+
1198
+ <dl>
1199
+ <dt>
1200
+ <div class="param-desc">
1201
+ <p>If file operations fail</p>
1202
+ </div>
1203
+ </dt>
1204
+ <dd></dd>
1205
+ <dt>
1206
+ <dl>
1207
+ <dt>
1208
+ Type
1209
+ </dt>
1210
+ <dd>
1211
+
1212
+ <span class="param-type"><a href="FileOperationError.html">FileOperationError</a></span>
1213
+
1214
+
1215
+ </dd>
1216
+ </dl>
1217
+ </dt>
1218
+ <dd></dd>
1219
+ </dl>
1220
+
1221
+ </li>
1222
+
1223
+ <li>
1224
+
1225
+ <dl>
1226
+ <dt>
1227
+ <div class="param-desc">
1228
+ <p>If CSV is malformed</p>
1229
+ </div>
1230
+ </dt>
1231
+ <dd></dd>
1232
+ <dt>
1233
+ <dl>
1234
+ <dt>
1235
+ Type
1236
+ </dt>
1237
+ <dd>
1238
+
1239
+ <span class="param-type"><a href="CsvFormatError.html">CsvFormatError</a></span>
1240
+
1241
+
1242
+ </dd>
1243
+ </dl>
1244
+ </dt>
1245
+ <dd></dd>
1246
+ </dl>
1247
+
1248
+ </li>
1249
+ </ul>
1250
+
1251
+
1252
+ <h5>Returns:</h5>
1253
+
1254
+
1255
+
1256
+
1257
+ <dl>
1258
+ <dt>
1259
+ Type
1260
+ </dt>
1261
+ <dd>
1262
+
1263
+ <span class="param-type">Promise.&lt;void></span>
1264
+
1265
+
1266
+ </dd>
1267
+ </dl>
1268
+
1269
+
1270
+
1271
+
1272
+
1273
+
1274
+
1275
+
1276
+
1277
+
1278
+
1279
+
1280
+
1281
+ <h4 class="name" id="getJsonFromCsvAsync"><span class="type-signature">(async) </span>getJsonFromCsvAsync<span class="signature">(inputFileNameOrCsv, options)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;object>>}</span></h4>
1282
+
1283
+
1284
+
1285
+
1286
+
1287
+
1288
+ <div class="description">
1289
+ <p>Main async API method for reading CSV and returning parsed JSON
1290
+ Supports reading from file path or parsing CSV string content</p>
1291
+ </div>
1292
+
1293
+
1294
+
1295
+
1296
+
1297
+
1298
+
1299
+
1300
+
1301
+ <h5>Parameters:</h5>
1302
+
1303
+
1304
+ <table class="params">
1305
+ <thead>
1306
+ <tr>
1307
+
1308
+ <th>Name</th>
1309
+
1310
+
1311
+ <th>Type</th>
1312
+
1313
+
1314
+
1315
+
1316
+
1317
+ <th class="last">Description</th>
1318
+ </tr>
1319
+ </thead>
1320
+
1321
+ <tbody>
1322
+
1323
+
1324
+ <tr>
1325
+
1326
+ <td class="name"><code>inputFileNameOrCsv</code></td>
1327
+
1328
+
1329
+ <td class="type">
1330
+
1331
+
1332
+ <span class="param-type">string</span>
1333
+
1334
+
1335
+
1336
+ </td>
1337
+
1338
+
1339
+
1340
+
1341
+
1342
+ <td class="description last"><p>File path or CSV string content</p></td>
1343
+ </tr>
1344
+
1345
+
1346
+
1347
+ <tr>
1348
+
1349
+ <td class="name"><code>options</code></td>
1350
+
1351
+
1352
+ <td class="type">
1353
+
1354
+
1355
+ <span class="param-type">object</span>
1356
+
1357
+
1358
+
1359
+ </td>
1360
+
1361
+
1362
+
1363
+
1364
+
1365
+ <td class="description last"><p>Configuration options</p>
1366
+ <h6>Properties</h6>
1367
+
1368
+
1369
+ <table class="params">
1370
+ <thead>
1371
+ <tr>
1372
+
1373
+ <th>Name</th>
1374
+
1375
+
1376
+ <th>Type</th>
1377
+
1378
+
1379
+
1380
+
1381
+
1382
+ <th class="last">Description</th>
1383
+ </tr>
1384
+ </thead>
1385
+
1386
+ <tbody>
1387
+
1388
+
1389
+ <tr>
1390
+
1391
+ <td class="name"><code>raw</code></td>
1392
+
1393
+
1394
+ <td class="type">
1395
+
1396
+
1397
+ <span class="param-type">boolean</span>
1398
+
1399
+
1400
+
1401
+ </td>
1402
+
1403
+
1404
+
1405
+
1406
+
1407
+ <td class="description last"><p>If true, treats input as CSV string; if false, reads from file</p></td>
1408
+ </tr>
1409
+
1410
+
1411
+ </tbody>
1412
+ </table>
1413
+
1414
+ </td>
1415
+ </tr>
1416
+
1417
+
1418
+ </tbody>
1419
+ </table>
1420
+
1421
+
1422
+
1423
+
1424
+
1425
+
1426
+ <dl class="details">
1427
+
1428
+
1429
+
1430
+
1431
+
1432
+
1433
+
1434
+
1435
+
1436
+
1437
+
1438
+
1439
+
1440
+
1441
+
1442
+
1443
+
1444
+
1445
+
1446
+
1447
+
1448
+
1449
+
1450
+
1451
+
1452
+
1453
+ <dt class="tag-source">Source:</dt>
1454
+ <dd class="tag-source"><ul class="dummy"><li>
1455
+ <a href="src_csvToJsonAsync.js.html">src/csvToJsonAsync.js</a>, <a href="src_csvToJsonAsync.js.html#line142">line 142</a>
1456
+ </li></ul></dd>
1457
+
1458
+
1459
+
1460
+
1461
+
1462
+
1463
+
1464
+ </dl>
1465
+
1466
+
1467
+
1468
+
1469
+
1470
+
1471
+
1472
+
1473
+
1474
+
1475
+
1476
+
1477
+
1478
+ <h5>Throws:</h5>
1479
+ <ul>
1480
+ <li>
1481
+
1482
+ <dl>
1483
+ <dt>
1484
+ <div class="param-desc">
1485
+ <p>If input is invalid</p>
1486
+ </div>
1487
+ </dt>
1488
+ <dd></dd>
1489
+ <dt>
1490
+ <dl>
1491
+ <dt>
1492
+ Type
1493
+ </dt>
1494
+ <dd>
1495
+
1496
+ <span class="param-type"><a href="InputValidationError.html">InputValidationError</a></span>
1497
+
1498
+
1499
+ </dd>
1500
+ </dl>
1501
+ </dt>
1502
+ <dd></dd>
1503
+ </dl>
1504
+
1505
+ </li>
1506
+
1507
+ <li>
1508
+
1509
+ <dl>
1510
+ <dt>
1511
+ <div class="param-desc">
1512
+ <p>If file read fails</p>
1513
+ </div>
1514
+ </dt>
1515
+ <dd></dd>
1516
+ <dt>
1517
+ <dl>
1518
+ <dt>
1519
+ Type
1520
+ </dt>
1521
+ <dd>
1522
+
1523
+ <span class="param-type"><a href="FileOperationError.html">FileOperationError</a></span>
1524
+
1525
+
1526
+ </dd>
1527
+ </dl>
1528
+ </dt>
1529
+ <dd></dd>
1530
+ </dl>
1531
+
1532
+ </li>
1533
+
1534
+ <li>
1535
+
1536
+ <dl>
1537
+ <dt>
1538
+ <div class="param-desc">
1539
+ <p>If CSV is malformed</p>
1540
+ </div>
1541
+ </dt>
1542
+ <dd></dd>
1543
+ <dt>
1544
+ <dl>
1545
+ <dt>
1546
+ Type
1547
+ </dt>
1548
+ <dd>
1549
+
1550
+ <span class="param-type"><a href="CsvFormatError.html">CsvFormatError</a></span>
1551
+
1552
+
1553
+ </dd>
1554
+ </dl>
1555
+ </dt>
1556
+ <dd></dd>
1557
+ </dl>
1558
+
1559
+ </li>
1560
+ </ul>
1561
+
1562
+
1563
+ <h5>Returns:</h5>
1564
+
1565
+
1566
+ <div class="param-desc">
1567
+ <p>Array of objects representing CSV rows</p>
1568
+ </div>
1569
+
1570
+
1571
+
1572
+ <dl>
1573
+ <dt>
1574
+ Type
1575
+ </dt>
1576
+ <dd>
1577
+
1578
+ <span class="param-type">Promise.&lt;Array.&lt;object>></span>
1579
+
1580
+
1581
+ </dd>
1582
+ </dl>
1583
+
1584
+
1585
+
1586
+
1587
+
1588
+
1589
+ <h5>Example</h5>
1590
+
1591
+ <pre class="prettyprint"><code>const csvToJson = require('convert-csv-to-json');
1592
+ const data = await csvToJson.getJsonFromCsvAsync('resource/input.csv');
1593
+ console.log(data);</code></pre>
1594
+
1595
+
1596
+
1597
+
1598
+
1599
+
1600
+
1601
+
1602
+
1603
+ <h4 class="name" id="getJsonFromCsvStringified"><span class="type-signature">(async) </span>getJsonFromCsvStringified<span class="signature">(fileInputName)</span><span class="type-signature"> &rarr; {Promise.&lt;string>}</span></h4>
1604
+
1605
+
1606
+
1607
+
1608
+
1609
+
1610
+ <div class="description">
1611
+ <p>Read a CSV file and return parsed data as stringified JSON (async)</p>
1612
+ </div>
1613
+
1614
+
1615
+
1616
+
1617
+
1618
+
1619
+
1620
+
1621
+
1622
+ <h5>Parameters:</h5>
1623
+
1624
+
1625
+ <table class="params">
1626
+ <thead>
1627
+ <tr>
1628
+
1629
+ <th>Name</th>
1630
+
1631
+
1632
+ <th>Type</th>
1633
+
1634
+
1635
+
1636
+
1637
+
1638
+ <th class="last">Description</th>
1639
+ </tr>
1640
+ </thead>
1641
+
1642
+ <tbody>
1643
+
1644
+
1645
+ <tr>
1646
+
1647
+ <td class="name"><code>fileInputName</code></td>
1648
+
1649
+
1650
+ <td class="type">
1651
+
1652
+
1653
+ <span class="param-type">string</span>
1654
+
1655
+
1656
+
1657
+ </td>
1658
+
1659
+
1660
+
1661
+
1662
+
1663
+ <td class="description last"><p>Path to input CSV file</p></td>
1664
+ </tr>
1665
+
1666
+
1667
+ </tbody>
1668
+ </table>
1669
+
1670
+
1671
+
1672
+
1673
+
1674
+
1675
+ <dl class="details">
1676
+
1677
+
1678
+
1679
+
1680
+
1681
+
1682
+
1683
+
1684
+
1685
+
1686
+
1687
+
1688
+
1689
+
1690
+
1691
+
1692
+
1693
+
1694
+
1695
+
1696
+
1697
+
1698
+
1699
+
1700
+
1701
+
1702
+ <dt class="tag-source">Source:</dt>
1703
+ <dd class="tag-source"><ul class="dummy"><li>
1704
+ <a href="src_csvToJsonAsync.js.html">src/csvToJsonAsync.js</a>, <a href="src_csvToJsonAsync.js.html#line122">line 122</a>
1705
+ </li></ul></dd>
1706
+
1707
+
1708
+
1709
+
1710
+
1711
+
1712
+
1713
+ </dl>
1714
+
1715
+
1716
+
1717
+
1718
+
1719
+
1720
+
1721
+
1722
+
1723
+
1724
+
1725
+
1726
+
1727
+ <h5>Throws:</h5>
1728
+ <ul>
1729
+ <li>
1730
+
1731
+ <dl>
1732
+ <dt>
1733
+ <div class="param-desc">
1734
+ <p>If file read fails</p>
1735
+ </div>
1736
+ </dt>
1737
+ <dd></dd>
1738
+ <dt>
1739
+ <dl>
1740
+ <dt>
1741
+ Type
1742
+ </dt>
1743
+ <dd>
1744
+
1745
+ <span class="param-type"><a href="FileOperationError.html">FileOperationError</a></span>
1746
+
1747
+
1748
+ </dd>
1749
+ </dl>
1750
+ </dt>
1751
+ <dd></dd>
1752
+ </dl>
1753
+
1754
+ </li>
1755
+
1756
+ <li>
1757
+
1758
+ <dl>
1759
+ <dt>
1760
+ <div class="param-desc">
1761
+ <p>If CSV is malformed</p>
1762
+ </div>
1763
+ </dt>
1764
+ <dd></dd>
1765
+ <dt>
1766
+ <dl>
1767
+ <dt>
1768
+ Type
1769
+ </dt>
1770
+ <dd>
1771
+
1772
+ <span class="param-type"><a href="CsvFormatError.html">CsvFormatError</a></span>
1773
+
1774
+
1775
+ </dd>
1776
+ </dl>
1777
+ </dt>
1778
+ <dd></dd>
1779
+ </dl>
1780
+
1781
+ </li>
1782
+ </ul>
1783
+
1784
+
1785
+ <h5>Returns:</h5>
1786
+
1787
+
1788
+ <div class="param-desc">
1789
+ <p>JSON stringified array of objects</p>
1790
+ </div>
1791
+
1792
+
1793
+
1794
+ <dl>
1795
+ <dt>
1796
+ Type
1797
+ </dt>
1798
+ <dd>
1799
+
1800
+ <span class="param-type">Promise.&lt;string></span>
1801
+
1802
+
1803
+ </dd>
1804
+ </dl>
1805
+
1806
+
1807
+
1808
+
1809
+
1810
+
1811
+
1812
+
1813
+
1814
+
1815
+
1816
+
1817
+
1818
+ <h4 class="name" id="indexHeader"><span class="type-signature"></span>indexHeader<span class="signature">(indexHeader)</span><span class="type-signature"> &rarr; {this}</span></h4>
1819
+
1820
+
1821
+
1822
+
1823
+
1824
+
1825
+ <div class="description">
1826
+ <p>Set the row index where CSV headers are located</p>
1827
+ </div>
1828
+
1829
+
1830
+
1831
+
1832
+
1833
+
1834
+
1835
+
1836
+
1837
+ <h5>Parameters:</h5>
1838
+
1839
+
1840
+ <table class="params">
1841
+ <thead>
1842
+ <tr>
1843
+
1844
+ <th>Name</th>
1845
+
1846
+
1847
+ <th>Type</th>
1848
+
1849
+
1850
+
1851
+
1852
+
1853
+ <th class="last">Description</th>
1854
+ </tr>
1855
+ </thead>
1856
+
1857
+ <tbody>
1858
+
1859
+
1860
+ <tr>
1861
+
1862
+ <td class="name"><code>indexHeader</code></td>
1863
+
1864
+
1865
+ <td class="type">
1866
+
1867
+
1868
+ <span class="param-type">number</span>
1869
+
1870
+
1871
+
1872
+ </td>
1873
+
1874
+
1875
+
1876
+
1877
+
1878
+ <td class="description last"><p>Zero-based row index containing headers</p></td>
1879
+ </tr>
1880
+
1881
+
1882
+ </tbody>
1883
+ </table>
1884
+
1885
+
1886
+
1887
+
1888
+
1889
+
1890
+ <dl class="details">
1891
+
1892
+
1893
+
1894
+
1895
+
1896
+
1897
+
1898
+
1899
+
1900
+
1901
+
1902
+
1903
+
1904
+
1905
+
1906
+
1907
+
1908
+
1909
+
1910
+
1911
+
1912
+
1913
+
1914
+
1915
+
1916
+
1917
+ <dt class="tag-source">Source:</dt>
1918
+ <dd class="tag-source"><ul class="dummy"><li>
1919
+ <a href="src_csvToJsonAsync.js.html">src/csvToJsonAsync.js</a>, <a href="src_csvToJsonAsync.js.html#line66">line 66</a>
1920
+ </li></ul></dd>
1921
+
1922
+
1923
+
1924
+
1925
+
1926
+
1927
+
1928
+ </dl>
1929
+
1930
+
1931
+
1932
+
1933
+
1934
+
1935
+
1936
+
1937
+
1938
+
1939
+
1940
+
1941
+
1942
+
1943
+
1944
+ <h5>Returns:</h5>
1945
+
1946
+
1947
+ <div class="param-desc">
1948
+ <p>For method chaining</p>
1949
+ </div>
1950
+
1951
+
1952
+
1953
+ <dl>
1954
+ <dt>
1955
+ Type
1956
+ </dt>
1957
+ <dd>
1958
+
1959
+ <span class="param-type">this</span>
1960
+
1961
+
1962
+ </dd>
1963
+ </dl>
1964
+
1965
+
1966
+
1967
+
1968
+
1969
+
1970
+
1971
+
1972
+
1973
+
1974
+
1975
+
1976
+
1977
+ <h4 class="name" id="mapRows"><span class="type-signature"></span>mapRows<span class="signature">(mapperFn)</span><span class="type-signature"> &rarr; {this}</span></h4>
1978
+
1979
+
1980
+
1981
+
1982
+
1983
+
1984
+ <div class="description">
1985
+ <p>Set a mapper function to transform each row after conversion</p>
1986
+ </div>
1987
+
1988
+
1989
+
1990
+
1991
+
1992
+
1993
+
1994
+
1995
+
1996
+ <h5>Parameters:</h5>
1997
+
1998
+
1999
+ <table class="params">
2000
+ <thead>
2001
+ <tr>
2002
+
2003
+ <th>Name</th>
2004
+
2005
+
2006
+ <th>Type</th>
2007
+
2008
+
2009
+
2010
+
2011
+
2012
+ <th class="last">Description</th>
2013
+ </tr>
2014
+ </thead>
2015
+
2016
+ <tbody>
2017
+
2018
+
2019
+ <tr>
2020
+
2021
+ <td class="name"><code>mapperFn</code></td>
2022
+
2023
+
2024
+ <td class="type">
2025
+
2026
+
2027
+ <span class="param-type">function</span>
2028
+
2029
+
2030
+
2031
+ </td>
2032
+
2033
+
2034
+
2035
+
2036
+
2037
+ <td class="description last"><p>Function receiving (row, index) that returns transformed row or null to filter</p></td>
2038
+ </tr>
2039
+
2040
+
2041
+ </tbody>
2042
+ </table>
2043
+
2044
+
2045
+
2046
+
2047
+
2048
+
2049
+ <dl class="details">
2050
+
2051
+
2052
+
2053
+
2054
+
2055
+
2056
+
2057
+
2058
+
2059
+
2060
+
2061
+
2062
+
2063
+
2064
+
2065
+
2066
+
2067
+
2068
+
2069
+
2070
+
2071
+
2072
+
2073
+
2074
+
2075
+
2076
+ <dt class="tag-source">Source:</dt>
2077
+ <dd class="tag-source"><ul class="dummy"><li>
2078
+ <a href="src_csvToJsonAsync.js.html">src/csvToJsonAsync.js</a>, <a href="src_csvToJsonAsync.js.html#line87">line 87</a>
2079
+ </li></ul></dd>
2080
+
2081
+
2082
+
2083
+
2084
+
2085
+
2086
+
2087
+ </dl>
2088
+
2089
+
2090
+
2091
+
2092
+
2093
+
2094
+
2095
+
2096
+
2097
+
2098
+
2099
+
2100
+
2101
+
2102
+
2103
+ <h5>Returns:</h5>
2104
+
2105
+
2106
+ <div class="param-desc">
2107
+ <p>For method chaining</p>
2108
+ </div>
2109
+
2110
+
2111
+
2112
+ <dl>
2113
+ <dt>
2114
+ Type
2115
+ </dt>
2116
+ <dd>
2117
+
2118
+ <span class="param-type">this</span>
2119
+
2120
+
2121
+ </dd>
2122
+ </dl>
2123
+
2124
+
2125
+
2126
+
2127
+
2128
+
2129
+
2130
+
2131
+
2132
+
2133
+
2134
+
2135
+
2136
+ <h4 class="name" id="parseSubArray"><span class="type-signature"></span>parseSubArray<span class="signature">(delimiter, separator)</span><span class="type-signature"> &rarr; {this}</span></h4>
2137
+
2138
+
2139
+
2140
+
2141
+
2142
+
2143
+ <div class="description">
2144
+ <p>Configure sub-array parsing for special field values</p>
2145
+ </div>
2146
+
2147
+
2148
+
2149
+
2150
+
2151
+
2152
+
2153
+
2154
+
2155
+ <h5>Parameters:</h5>
2156
+
2157
+
2158
+ <table class="params">
2159
+ <thead>
2160
+ <tr>
2161
+
2162
+ <th>Name</th>
2163
+
2164
+
2165
+ <th>Type</th>
2166
+
2167
+
2168
+
2169
+
2170
+ <th>Default</th>
2171
+
2172
+
2173
+ <th class="last">Description</th>
2174
+ </tr>
2175
+ </thead>
2176
+
2177
+ <tbody>
2178
+
2179
+
2180
+ <tr>
2181
+
2182
+ <td class="name"><code>delimiter</code></td>
2183
+
2184
+
2185
+ <td class="type">
2186
+
2187
+
2188
+ <span class="param-type">string</span>
2189
+
2190
+
2191
+
2192
+ </td>
2193
+
2194
+
2195
+
2196
+
2197
+ <td class="default">
2198
+
2199
+ *
2200
+
2201
+ </td>
2202
+
2203
+
2204
+ <td class="description last"><p>Bracket character (default: '*')</p></td>
2205
+ </tr>
2206
+
2207
+
2208
+
2209
+ <tr>
2210
+
2211
+ <td class="name"><code>separator</code></td>
2212
+
2213
+
2214
+ <td class="type">
2215
+
2216
+
2217
+ <span class="param-type">string</span>
2218
+
2219
+
2220
+
2221
+ </td>
2222
+
2223
+
2224
+
2225
+
2226
+ <td class="default">
2227
+
2228
+ ,
2229
+
2230
+ </td>
2231
+
2232
+
2233
+ <td class="description last"><p>Item separator within brackets (default: ',')</p></td>
2234
+ </tr>
2235
+
2236
+
2237
+ </tbody>
2238
+ </table>
2239
+
2240
+
2241
+
2242
+
2243
+
2244
+
2245
+ <dl class="details">
2246
+
2247
+
2248
+
2249
+
2250
+
2251
+
2252
+
2253
+
2254
+
2255
+
2256
+
2257
+
2258
+
2259
+
2260
+
2261
+
2262
+
2263
+
2264
+
2265
+
2266
+
2267
+
2268
+
2269
+
2270
+
2271
+
2272
+ <dt class="tag-source">Source:</dt>
2273
+ <dd class="tag-source"><ul class="dummy"><li>
2274
+ <a href="src_csvToJsonAsync.js.html">src/csvToJsonAsync.js</a>, <a href="src_csvToJsonAsync.js.html#line77">line 77</a>
2275
+ </li></ul></dd>
2276
+
2277
+
2278
+
2279
+
2280
+
2281
+
2282
+
2283
+ </dl>
2284
+
2285
+
2286
+
2287
+
2288
+
2289
+
2290
+
2291
+
2292
+
2293
+
2294
+
2295
+
2296
+
2297
+
2298
+
2299
+ <h5>Returns:</h5>
2300
+
2301
+
2302
+ <div class="param-desc">
2303
+ <p>For method chaining</p>
2304
+ </div>
2305
+
2306
+
2307
+
2308
+ <dl>
2309
+ <dt>
2310
+ Type
2311
+ </dt>
2312
+ <dd>
2313
+
2314
+ <span class="param-type">this</span>
2315
+
2316
+
2317
+ </dd>
2318
+ </dl>
2319
+
2320
+
2321
+
2322
+
2323
+
2324
+
2325
+
2326
+
2327
+
2328
+
2329
+
2330
+
2331
+
2332
+ <h4 class="name" id="supportQuotedField"><span class="type-signature"></span>supportQuotedField<span class="signature">(active)</span><span class="type-signature"> &rarr; {this}</span></h4>
2333
+
2334
+
2335
+
2336
+
2337
+
2338
+
2339
+ <div class="description">
2340
+ <p>Enable or disable support for RFC 4180 quoted fields</p>
2341
+ </div>
2342
+
2343
+
2344
+
2345
+
2346
+
2347
+
2348
+
2349
+
2350
+
2351
+ <h5>Parameters:</h5>
2352
+
2353
+
2354
+ <table class="params">
2355
+ <thead>
2356
+ <tr>
2357
+
2358
+ <th>Name</th>
2359
+
2360
+
2361
+ <th>Type</th>
2362
+
2363
+
2364
+
2365
+
2366
+
2367
+ <th class="last">Description</th>
2368
+ </tr>
2369
+ </thead>
2370
+
2371
+ <tbody>
2372
+
2373
+
2374
+ <tr>
2375
+
2376
+ <td class="name"><code>active</code></td>
2377
+
2378
+
2379
+ <td class="type">
2380
+
2381
+
2382
+ <span class="param-type">boolean</span>
2383
+
2384
+
2385
+
2386
+ </td>
2387
+
2388
+
2389
+
2390
+
2391
+
2392
+ <td class="description last"><p>Whether to support quoted fields</p></td>
2393
+ </tr>
2394
+
2395
+
2396
+ </tbody>
2397
+ </table>
2398
+
2399
+
2400
+
2401
+
2402
+
2403
+
2404
+ <dl class="details">
2405
+
2406
+
2407
+
2408
+
2409
+
2410
+
2411
+
2412
+
2413
+
2414
+
2415
+
2416
+
2417
+
2418
+
2419
+
2420
+
2421
+
2422
+
2423
+
2424
+
2425
+
2426
+
2427
+
2428
+
2429
+
2430
+
2431
+ <dt class="tag-source">Source:</dt>
2432
+ <dd class="tag-source"><ul class="dummy"><li>
2433
+ <a href="src_csvToJsonAsync.js.html">src/csvToJsonAsync.js</a>, <a href="src_csvToJsonAsync.js.html#line36">line 36</a>
2434
+ </li></ul></dd>
2435
+
2436
+
2437
+
2438
+
2439
+
2440
+
2441
+
2442
+ </dl>
2443
+
2444
+
2445
+
2446
+
2447
+
2448
+
2449
+
2450
+
2451
+
2452
+
2453
+
2454
+
2455
+
2456
+
2457
+
2458
+ <h5>Returns:</h5>
2459
+
2460
+
2461
+ <div class="param-desc">
2462
+ <p>For method chaining</p>
2463
+ </div>
2464
+
2465
+
2466
+
2467
+ <dl>
2468
+ <dt>
2469
+ Type
2470
+ </dt>
2471
+ <dd>
2472
+
2473
+ <span class="param-type">this</span>
2474
+
2475
+
2476
+ </dd>
2477
+ </dl>
2478
+
2479
+
2480
+
2481
+
2482
+
2483
+
2484
+
2485
+
2486
+
2487
+
2488
+
2489
+
2490
+
2491
+ <h4 class="name" id="trimHeaderFieldWhiteSpace"><span class="type-signature"></span>trimHeaderFieldWhiteSpace<span class="signature">(active)</span><span class="type-signature"> &rarr; {this}</span></h4>
2492
+
2493
+
2494
+
2495
+
2496
+
2497
+
2498
+ <div class="description">
2499
+ <p>Configure whitespace handling in header field names</p>
2500
+ </div>
2501
+
2502
+
2503
+
2504
+
2505
+
2506
+
2507
+
2508
+
2509
+
2510
+ <h5>Parameters:</h5>
2511
+
2512
+
2513
+ <table class="params">
2514
+ <thead>
2515
+ <tr>
2516
+
2517
+ <th>Name</th>
2518
+
2519
+
2520
+ <th>Type</th>
2521
+
2522
+
2523
+
2524
+
2525
+
2526
+ <th class="last">Description</th>
2527
+ </tr>
2528
+ </thead>
2529
+
2530
+ <tbody>
2531
+
2532
+
2533
+ <tr>
2534
+
2535
+ <td class="name"><code>active</code></td>
2536
+
2537
+
2538
+ <td class="type">
2539
+
2540
+
2541
+ <span class="param-type">boolean</span>
2542
+
2543
+
2544
+
2545
+ </td>
2546
+
2547
+
2548
+
2549
+
2550
+
2551
+ <td class="description last"><p>If true, removes all whitespace; if false, only trims edges</p></td>
2552
+ </tr>
2553
+
2554
+
2555
+ </tbody>
2556
+ </table>
2557
+
2558
+
2559
+
2560
+
2561
+
2562
+
2563
+ <dl class="details">
2564
+
2565
+
2566
+
2567
+
2568
+
2569
+
2570
+
2571
+
2572
+
2573
+
2574
+
2575
+
2576
+
2577
+
2578
+
2579
+
2580
+
2581
+
2582
+
2583
+
2584
+
2585
+
2586
+
2587
+
2588
+
2589
+
2590
+ <dt class="tag-source">Source:</dt>
2591
+ <dd class="tag-source"><ul class="dummy"><li>
2592
+ <a href="src_csvToJsonAsync.js.html">src/csvToJsonAsync.js</a>, <a href="src_csvToJsonAsync.js.html#line56">line 56</a>
2593
+ </li></ul></dd>
2594
+
2595
+
2596
+
2597
+
2598
+
2599
+
2600
+
2601
+ </dl>
2602
+
2603
+
2604
+
2605
+
2606
+
2607
+
2608
+
2609
+
2610
+
2611
+
2612
+
2613
+
2614
+
2615
+
2616
+
2617
+ <h5>Returns:</h5>
2618
+
2619
+
2620
+ <div class="param-desc">
2621
+ <p>For method chaining</p>
2622
+ </div>
2623
+
2624
+
2625
+
2626
+ <dl>
2627
+ <dt>
2628
+ Type
2629
+ </dt>
2630
+ <dd>
2631
+
2632
+ <span class="param-type">this</span>
2633
+
2634
+
2635
+ </dd>
2636
+ </dl>
2637
+
2638
+
2639
+
2640
+
2641
+
2642
+
2643
+
2644
+
2645
+
2646
+
2647
+
2648
+
2649
+
2650
+ </article>
2651
+
2652
+ </section>
2653
+
2654
+
2655
+
2656
+
2657
+ </div>
2658
+
2659
+ <nav>
2660
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BrowserApi.html">BrowserApi</a></li><li><a href="BrowserApiError.html">BrowserApiError</a></li><li><a href="ConfigurationError.html">ConfigurationError</a></li><li><a href="CsvFormatError.html">CsvFormatError</a></li><li><a href="CsvParsingError.html">CsvParsingError</a></li><li><a href="CsvToJson.html">CsvToJson</a></li><li><a href="CsvToJsonAsync.html">CsvToJsonAsync</a></li><li><a href="FileOperationError.html">FileOperationError</a></li><li><a href="FileUtils.html">FileUtils</a></li><li><a href="InputValidationError.html">InputValidationError</a></li><li><a href="JsonUtil.html">JsonUtil</a></li><li><a href="JsonValidationError.html">JsonValidationError</a></li></ul><h3>Global</h3><ul><li><a href="global.html#asciiEncoding">asciiEncoding</a></li><li><a href="global.html#base64Encoding">base64Encoding</a></li><li><a href="global.html#browser">browser</a></li><li><a href="global.html#csvStringToJson">csvStringToJson</a></li><li><a href="global.html#csvStringToJsonStringified">csvStringToJsonStringified</a></li><li><a href="global.html#csvToJsonAsync">csvToJsonAsync</a></li><li><a href="global.html#customEncoding">customEncoding</a></li><li><a href="global.html#fieldDelimiter">fieldDelimiter</a></li><li><a href="global.html#formatValueByType">formatValueByType</a></li><li><a href="global.html#generateJsonFileFromCsv">generateJsonFileFromCsv</a></li><li><a href="global.html#getJsonFromCsv">getJsonFromCsv</a></li><li><a href="global.html#hexEncoding">hexEncoding</a></li><li><a href="global.html#indexHeader">indexHeader</a></li><li><a href="global.html#latin1Encoding">latin1Encoding</a></li><li><a href="global.html#mapRows">mapRows</a></li><li><a href="global.html#parseSubArray">parseSubArray</a></li><li><a href="global.html#supportQuotedField">supportQuotedField</a></li><li><a href="global.html#trimHeaderFieldWhiteSpace">trimHeaderFieldWhiteSpace</a></li><li><a href="global.html#ucs2Encoding">ucs2Encoding</a></li><li><a href="global.html#utf16leEncoding">utf16leEncoding</a></li><li><a href="global.html#utf8Encoding">utf8Encoding</a></li></ul>
2661
+ </nav>
2662
+
2663
+ <br class="clear">
2664
+
2665
+ <footer>
2666
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.5</a> on Fri Mar 20 2026 14:48:29 GMT+0000 (Coordinated Universal Time)
2667
+ </footer>
2668
+
2669
+ <script> prettyPrint(); </script>
2670
+ <script src="scripts/linenumber.js"> </script>
2671
+ </body>
2672
+ </html>