You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
await oxr.latest();
// You can now use `oxr.rates`, `oxr.base` and `oxr.timestamp`
console.log('oxr.rates', oxr.rates);
console.log('oxr.base', oxr.base);
console.log('oxr.timestamp', oxr.timestamp);
UPDATE:
It appears it doesn't work with "await".
The following works but I am not sure how to use it like that for my use case as I need to wait for the results and then do something else.
oxr.latest(function() {
// You can now use `oxr.rates`, `oxr.base` and `oxr.timestamp`
console.log('oxr', oxr);
console.log('oxr.rates', oxr.rates);
console.log('oxr.base', oxr.base);
console.log('oxr.timestamp', oxr.timestamp);
});
The text was updated successfully, but these errors were encountered:
const oxr = require('open-exchange-rates');
oxr.set({ app_id: OXR_APP_ID })
Using version 0.3.0
My app id works fine using:
https://openexchangerates.org/api/latest.json?app_id=
UPDATE:
It appears it doesn't work with "await".
The following works but I am not sure how to use it like that for my use case as I need to wait for the results and then do something else.
The text was updated successfully, but these errors were encountered: