I want to read the "name" and "tel" from data.json(json file) by using app.js(node js file)
This is data.json file
{
"result": {
"site": {
"list": [
{
"name": "imready",
"tel": "0123456789"
},
{
"name": "hihello",
"tel": "9876543210"
}
]
}
}
}
This is the app.js file:
fs.readFile('data.json', 'utf8', function(err, data) {
console.log(data)});
I want to get: "name": "imready", "tel": "0123456789","name": "hihello", "tel": "9876543210".
How can do this?