fs.readFile("user.json", function (err, data) {
if (err) throw err;
console.log(data.toString());
});
fs.readFile("user.json", function (err, data) {
if (err) throw err;
console.log(data.toString());
});
You could use JSON.parse, something like this:
fs.readFile("user.json", function (err, data) {
if (err) throw err;
obj = JSON.parse(data);
console.log(obj.nombre);
});
Good luck!