Skip to content
Advertisement

create json object from csv file data coming as buffer in request in node js

I’m processing csv file data coming from request to create json object using multer,csv-parser. but can’t process from long time. please help and thanks.following is example of csv file processing.

JavaScript

here I’m using fs module that works for me but I don’t want to store data in file instead I want to process buffer data coming from req.file.buffer in chunk I’m stuck here please help. because storing file and reading same file getting process slow because csv file have thousands of data.

Advertisement

Answer

The idea is to create a readable stream from the buffer instead of writing it to the file as follows:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement