I'm using the promis module to return my json data from the request module, but every time i run it, it gives me this.
Promise { _45: 0, _81: 0, _65: null, _54: null }
I can't get it to work, any one know the problem? here is my code:
function parse(){
return new Promise(function(json){
request('https://bitskins.com/api/v1/get_account_balance/?api_key='+api+'&code='+code, function (error, response, body) {
json(JSON.parse(body).data.available_balance);
});
});
}
console.log(parse());