I want to get local file as a file object no Buffer, I need File{} object. readSync giving me Buffer.
According to the documentation :
fs.readFile(path[, options])
options <Object> | <string>
encoding <string> | <null> Default: null
If no encoding is specified, then the raw buffer is returned.
Solution : specify an encoding.
fs.readFile(path, { encoding: "utf8"})