cnb-exchange-rate
v2.0.1
Published
Czech daily exchange rate from czech national bank
Downloads
18
Maintainers
Readme
cnb-exchange-rate
Library can fetch czech daily exchange rate from Česká národní banka and return as object.
example js
const cnbExchangeRate = require('cnb-exchange-rate');
async function download() {
try {
const exchangeRateAsString = await cnbExchangeRate.fetch();
const exchangeRate = cnbExchangeRate.parse(exchangeRateAsString);
console.log(exchangeRate);
} catch (err) {
if (err.statusCode !== 200) {
console.log(`I can\`t fetch czech daily course. Server returns status code: ${err.statusCode}`);
} else {
console.log(`I can\`t parse czech daily course. Error: ${err}`);
}
}
}
download();