@asefux/exchange-rates

1.1.1 • Public • Published

@asefux/exchange-rates

gather exchange-rates from muiltiplie national banks

Usage

const ExchangeRates = require('@asefux/exchange-rates');

const exchangeRates = ExchangeRates();

exchangeRates.matrix()
.then((ratesMatrix)=>{
        console.log(JSON.stringify(ratesMatrix, null, 2));
});

exchangeRates.rate(10, 'eur', 'usd').then(console.log); // will output how much USD is 10 EUR

Rates matrix of this format

{
        [base]: {
                [quote]: price
        }
}
// how much quote would you get for 1 unit of base

Sources


Changes

Version Changes
1.0.0 initial code
1.0.1 update api
1.1.0 Bank of Bulgaria
1.1.1 on weekends get rates of last working day

Package Sidebar

Install

npm i @asefux/exchange-rates

Weekly Downloads

4

Version

1.1.1

License

UNLICENSED

Unpacked Size

23.1 kB

Total Files

15

Last publish

Collaborators

  • asefux