In the end, I was a bit disappointed and decided to just write my own CSV parser to see if that could address my needs: small, fast, and with support for nested objects. You can solve it with a pre- and post-processing step to flatten your data, but that feels like something a CSV library can do for you. To me this is an essential feature since nested data structures are just so common in JavaScript. ![]() One limitation that most of the CSV libraries for JavaScript out there have in common is no built-in support for nested JSON objects. Which is odd, since there are so many CSV libraries out there. All in all it was quite a struggle to find a library that suited my needs. Other libraries are focussed on node.js and not the browser. ![]() So I selected another library, only to find out that this library was huge in size, too large for my taste to use in my web application in the browser. So I picked another popular library, only to find out that it was more than twice as slow as the library I used before, that was a bit too much for me. No problem I thought, I’ll just pick another CSV library, there are plenty of them. However, the CSV library I was using did not support CSV to JSON. I expected this to be a no-brainer: just to the same as the CSV export but then the other way around. Recently, I wanted to implement CSV import for JSON Editor Online. I do not remember why I chose that specific library, but it just worked like a charm. ![]() I used the excellent json2csv library to convert JSON to CSV. Some time ago, I implemented CSV export functionality for JSON Editor Online. ![]() …but I ended up writing the fastest JavaScript CSV parser out there.
0 Comments
Leave a Reply. |