Below is my code to read a JSON file which is already downloaded and stored in "TemporaryDirectoryPath".
var fileName = getFileNameFromUrl(url);
RNFS.downloadFile({
fromUrl: url,
toFile: `${RNFS.TemporaryDirectoryPath}/`+fileName
}).promise.then(r => {
var content = RNFS.readFile(`${RNFS.TemporaryDirectoryPath}/`+fileName, 'utf8');
console.log(content);
});
I am getting an object of type "Promise" as below
Promise {_40: 0, _65: 0, _55: null, _72: null}
_40: 0
_55: "{"show_explanation":1,"answer_result":2, //More json content will be here}"
_65: 1
_72: null
How to read content from that Promise object?