SyntaxError: Unexpected token in JSON at position 0
var fs = require("fs");
fs.readFile("text.json", function(err, data) {
if (err) throw err;
var arr = data.toString();
arr = JSON.parse(arr);
console.log(arr.title);
});
JSON:
{
"title": "Закрыть",
"action": "CloseDoc"
}