let fb = fs.readFileSync(filePath);
let fileData = fb.toString("utf8");
b = Buffer.from(fileData, "utf8");
console.log(fb);
console.log(b);
console.log(b == fb);
console.log(b.toString("utf8") === fb.toString("utf8"));
I converted buffer to UTF8 string and again tried to get the buffer back using Buffer.from() but I can see that two buffer are different. However, if I again compare toString() result of these two buffers they are same.
Output of the above program
