excel-as-json
excel-as-json copied to clipboard
Adding support for reading CSV files.
I added support for reading CSV files. This will provide better support for users who want to use this module with the option of the alternative spreadsheet format. The changes are as follows:
- Added dependencies on mime for detecting file type and csv-parse for parsing CSV files.
- Added a test case to ensure that row-oriented.xlsx parses to the same JSON as row-oriented.csv.
- Replaced the row-oriented.csv failure test case with a GIF file.
Coverage remained the same at 100.0% when pulling 0c680ac05fb0dd8645a08dddb2cfd76d5becb4ea on vote539:csv-support into 38306137ae1cff21d2ce0d9d28ef1c002ea5440c on stevetarver:master.
Current coverage is 100% (diff: 100%)
@@ master #4 diff @@
===================================
Files 1 1
Lines 78 116 +38
Methods 1 1
Messages 0 0
Branches 17 21 +4
===================================
+ Hits 78 116 +38
Misses 0 0
Partials 0 0
Powered by Codecov. Last update 3830613...1e76897
Coverage decreased (-14.05%) to 85.95% when pulling afa253d14e3cf11b5c18fa733ee99ade7e58c113 on vote539:csv-support into 38306137ae1cff21d2ce0d9d28ef1c002ea5440c on stevetarver:master.
In addition to the basic CSV support, I added a synchronous API to my branch (including tests and documentation). Note that since the dependency "excel" does not expose a synchronous API, right now the synchronous API does not support XLSX files.
Coverage decreased (-0.9%) to 99.138% when pulling 14e7bddb7e02d394b66c027ed3c3678bb9f917c6 on vote539:csv-support into 38306137ae1cff21d2ce0d9d28ef1c002ea5440c on stevetarver:master.
Coverage decreased (-0.9%) to 99.138% when pulling 2609450160c193e5ed2db60a99a64aa17026facd on vote539:csv-support into 38306137ae1cff21d2ce0d9d28ef1c002ea5440c on stevetarver:master.
Coverage remained the same at 100.0% when pulling 1e7689777e222a21b74dbfb1c3f047728c3e843e on vote539:csv-support into 38306137ae1cff21d2ce0d9d28ef1c002ea5440c on stevetarver:master.
FYI, for the time being I have made my changes available via the npm package "@vote539/excel-as-json"