i need to write the final object formed after a lot of async requests to a JSON file.
Here is the layout of my file
var finalObj = {}; for(i=0;i<100;i++){ request.get("http://example.com/get/" +i,function(err,res,body){ var tObj = json.parse(body); finalObj[tObj.name] = tObj.value; }) }
after all the response object is recieved, i want to save the finalObj to a json file. How do i do this?