I have:
fs.readFile(\'../services/Prescipcion.xml\', \"utf8\", function (err, data) { console.log(\"err->\", err); console.log(\"data\", data); });
It worked for me
var fs = require("fs"); const readFIle = path => { fs.readFile(__dirname + path, "utf8", (err, data) => { if (err) { console.log(err.stack); return; } console.log(data.toString()); }); console.log("Program Ended"); };
usage:
readFIle("/input.txt");