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