opengovsg / postmangovsg

Templated message sending for public officers
https://postman.gov.sg
59 stars 18 forks source link

Refactoring parsing of CSV #432

Closed lshaowei18 closed 4 years ago

lshaowei18 commented 4 years ago

Is your feature request related to a problem? Please describe. We want to use the same code for frontend and backend for parseCsv. However, with the current implementation, parseCsv only works on nodejs because it is making use of Nodejs.ReadableStream and the library csv-parse doesn't work on browsers.

Describe the solution you'd like Find a way to rewrite parseCsv such that it can be used both on frontend and backend. Could rewrite it in papaparse etc.

lshaowei18 commented 4 years ago

Different use cases for frontend and backend so we didn't use the same code. We did switch to papaparse for backend through #557