var path = require("path"); // OR: import { resolve } from 'path';
var absolutePath = path.resolve("Relative file path");
You dir structure for example:
C:->WebServer->Public->Uploads->MyFile.csv
and your working directory would be Public for example, path.resolve would be like this:
path.resolve("./Uploads/MyFile.csv");
POSIX: home/WebServer/Public/Uploads/MyFile.csv
WINDOWS: C:\WebServer\Public\Uploads\MyFile.csv
this solution is multiplatform and allows your application to work on both Windows and Posix machines.