Send downloadable csv using papaparse and streams

141 Views Asked by At

I have table in postgresql which I want to convert to csv and send as downloadable file to response using streams

I have the following export service:

export class ExportService {
  public static toCsv<T>(data:T[], res:Response):void {
    const csv = Papa.unparse(data);
   
  }
}

Now, what I want here is to send this csv to the response with streams. Could you please help me to get right approach for this?

0

There are 0 best solutions below