Closed lazarusvc closed 8 years ago
var jsonfile = require('jsonfile')
var file = 'myfile.json'
console.log(jsonfile.readFileSync(file).data.points)
Okay but what if it's in the format :
{ "data": [ { "email": " ", "products": [ ], "username": " " }, { "email": " ", "products": [ { "actual_food_amount": "15", "amount": "20", "drink": "Local Drink ", "food": "Dasheen meal w/ codfish", "id": 2, "location": "Orchard Restaurant" } ] } }
and I want to read "food"
If I have a Json file say:
How do I read "points" value?