Sign in

So if you are working with Node.js you probably faced an issue where you needed to read a file but you ended up a file not found error because of the invalid pathname.

if you faced then you know, but if you don’t let me explain,

file structure
file structure

so here we can see the directory structure, data folder contain two csv file which we needed to read, for that we have a function in dataread.js under src/server using this function we will read the csv and convert it to json object.

above you can see the function getDataObject to read and…

Aswanth KP

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store